diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-05-30 20:45:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-05-30 20:45:12 +0000 |
commit | a481b01e958b19c2eb6564ab8930eae9058967f8 (patch) | |
tree | 28a023709f019a84982f199585e8cd9c590b59e3 /clang/test | |
parent | a4e3b50e2651510d2d93a0f3128d4bcceb3ea3d3 (diff) | |
download | bcm5719-llvm-a481b01e958b19c2eb6564ab8930eae9058967f8.tar.gz bcm5719-llvm-a481b01e958b19c2eb6564ab8930eae9058967f8.zip |
[c++2a] Fix assertion failure if we would walk over more than one level
of derived-to-base conversion path when implicitly starting union
subobject lifetimes in constant evaluation.
llvm-svn: 362147
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/constant-expression-cxx2a.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constant-expression-cxx2a.cpp b/clang/test/SemaCXX/constant-expression-cxx2a.cpp index aa534ce592e..f29f4beb290 100644 --- a/clang/test/SemaCXX/constant-expression-cxx2a.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx2a.cpp @@ -521,4 +521,14 @@ namespace Union { u1 = u2; return true; }(); + + struct S1 { + int n; + }; + struct S2 : S1 {}; + struct S3 : S2 {}; + void f() { + S3 s; + s.n = 0; + } } |