diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-03 08:26:00 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-03 08:26:00 +0000 |
commit | 80fe8a6c2142df4718e2482a0562ee6142de1685 (patch) | |
tree | 9d6edb9d38af9d9163661f2a5b51c78392a678d2 /test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | ea7885793bc604f566db6d1d99c845bfec6b8119 (diff) |
Implement DR990 and DR1070. Aggregate initialization initializes uninitialized
elements from {}, rather than value-initializing them. This permits calling an
initializer-list constructor or constructing a std::initializer_list object.
(It would also permit initializing a const reference or rvalue reference if
that weren't explicitly prohibited by other rules.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp index 4bc24e88be..9c8d7f1196 100644 --- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -S -triple x86_64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -triple x86_64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s namespace std { typedef decltype(sizeof(int)) size_t; @@ -431,3 +431,20 @@ namespace nested { // CHECK: } } } + +namespace DR1070 { + struct A { + A(std::initializer_list<int>); + }; + struct B { + int i; + A a; + }; + B b = {1}; + struct C { + std::initializer_list<int> a; + B b; + std::initializer_list<double> c; + }; + C c = {}; +} |