diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-17 00:11:41 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-17 00:11:41 +0000 |
commit | 0a9969b36b16307e6cf60004b108be972c93d336 (patch) | |
tree | b9e216b9ac175f3a86b748a5effc1190bb161793 /clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | 1c1de452570b525f1a7ed9f7da919e0af16c23bd (diff) | |
download | llvm-0a9969b36b16307e6cf60004b108be972c93d336.zip llvm-0a9969b36b16307e6cf60004b108be972c93d336.tar.gz llvm-0a9969b36b16307e6cf60004b108be972c93d336.tar.bz2 |
Restructure checking for, and warning on, lifetime extension.
This change implements C++ DR1696, which makes initialization of a
reference member of a class from a temporary object ill-formed. The
standard wording here is imprecise, but we interpret it as meaning that
any time a mem-initializer would result in lifetime extension, the
program is ill-formed.
llvm-svn: 337226
Diffstat (limited to 'clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp index 3299763..0184a1d 100644 --- a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -236,36 +236,6 @@ void fn9() { // CHECK: ret void } -struct haslist1 { - std::initializer_list<int> il; - haslist1(int i); -}; - -// CHECK-LABEL: define void @_ZN8haslist1C2Ei -haslist1::haslist1(int i) -// CHECK: alloca [3 x i32] -// CHECK: store i32 % -// CHECK: store i32 2 -// CHECK: store i32 3 - : il{i, 2, 3} -{ - destroyme2 dm2; -} - -struct haslist2 { - std::initializer_list<destroyme1> il; - haslist2(); -}; - -// CHECK-LABEL: define void @_ZN8haslist2C2Ev -haslist2::haslist2() - : il{destroyme1(), destroyme1()} -{ - destroyme2 dm2; - // CHECK: call void @_ZN10destroyme2D1Ev - // CHECK: call void @_ZN10destroyme1D1Ev -} - void fn10(int i) { // CHECK-LABEL: define void @_Z4fn10i // CHECK: alloca [3 x i32] |