r182615 - Fix assert on temporary std::initializer_list.
Richard Smith
richard at metafoo.co.uk
Thu May 23 15:23:27 PDT 2013
Hi John, OK for 3.3 branch?
On Thu, May 23, 2013 at 2:54 PM, Richard Smith
<richard-llvm at metafoo.co.uk>wrote:
> 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() };
> + }
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130523/db002531/attachment.html>
More information about the cfe-commits
mailing list