r182615 - Fix assert on temporary std::initializer_list.
Richard Smith
richard-llvm at metafoo.co.uk
Thu May 23 14:54:14 PDT 2013
Author: rsmith
Date: Thu May 23 16:54:14 2013
New Revision: 182615
URL: http://llvm.org/viewvc/llvm-project?rev=182615&view=rev
Log:
Fix assert on temporary std::initializer_list.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=182615&r1=182614&r2=182615&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Thu May 23 16:54:14 2013
@@ -1159,12 +1159,13 @@ void AggExprEmitter::VisitInitListExpr(I
if (E->hadArrayRangeDesignator())
CGF.ErrorUnsupported(E, "GNU array range designator extension");
+ AggValueSlot Dest = EnsureSlot(E->getType());
+
if (E->initializesStdInitializerList()) {
EmitStdInitializerList(Dest.getAddr(), E);
return;
}
- AggValueSlot Dest = EnsureSlot(E->getType());
LValue DestLV = CGF.MakeAddrLValue(Dest.getAddr(), E->getType(),
Dest.getAlignment());
Modified: cfe/trunk/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp?rev=182615&r1=182614&r2=182615&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp Thu May 23 16:54:14 2013
@@ -275,3 +275,13 @@ namespace rdar13325066 {
for (X x : { x1, x2 }) { }
}
}
+
+namespace dtors {
+ struct S {
+ S();
+ ~S();
+ };
+ void f() {
+ std::initializer_list<S>{ S(), S() };
+ }
+}
More information about the cfe-commits
mailing list