diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-05 08:39:21 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-05 08:39:21 +0000 |
| commit | d86812d95c3a592f40e5249dfef324b456ea26d7 (patch) | |
| tree | 08c65181fea1a97eaee55fe64b20979d55e80893 /clang/test/CodeGenCXX/const-init-cxx11.cpp | |
| parent | 1ea42eb5a33bb48c5ce085e27c2701a6e8563645 (diff) | |
| download | bcm5719-llvm-d86812d95c3a592f40e5249dfef324b456ea26d7.tar.gz bcm5719-llvm-d86812d95c3a592f40e5249dfef324b456ea26d7.zip | |
PR13273: When performing list-initialization with an empty initializer list,
actually perform value initialization rather than trying to fake it with a call
to the default constructor. Fixes various bugs related to the previously-missing
zero-initialization in this case.
I've also moved this and the other list initialization 'special case' from
TryConstructorInitialization into TryListInitialization where they belong.
llvm-svn: 159733
Diffstat (limited to 'clang/test/CodeGenCXX/const-init-cxx11.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/const-init-cxx11.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/const-init-cxx11.cpp b/clang/test/CodeGenCXX/const-init-cxx11.cpp index d1b91ba3f5c..07385eedbae 100644 --- a/clang/test/CodeGenCXX/const-init-cxx11.cpp +++ b/clang/test/CodeGenCXX/const-init-cxx11.cpp @@ -309,6 +309,20 @@ namespace VirtualMembers { static nsMemoryImpl sGlobalMemory; } +namespace PR13273 { + struct U { + int t; + U() = default; + }; + + struct S : U { + S() = default; + }; + + // CHECK: @_ZN7PR13273L1sE = {{.*}} zeroinitializer + const S s {}; +} + // Constant initialization tests go before this point, // dynamic initialization tests go after. |

