From: John McCall Date: Fri, 26 Aug 2011 05:38:08 +0000 (+0000) Subject: An initialization does not alias. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90b2bdf3b96892ea44e5bf6869a92a08d09a6545;p=clang An initialization does not alias. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138624 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 1ed24ccd65..88536e2acd 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -138,7 +138,8 @@ void CodeGenFunction::EmitAnyExprToMem(const Expr *E, else if (hasAggregateLLVMType(E->getType())) EmitAggExpr(E, AggValueSlot::forAddr(Location, Quals, AggValueSlot::IsDestructed_t(IsInit), - AggValueSlot::DoesNotNeedGCBarriers)); + AggValueSlot::DoesNotNeedGCBarriers, + AggValueSlot::IsAliased_t(!IsInit))); else { RValue RV = RValue::get(EmitScalarExpr(E, /*Ignore*/ false)); LValue LV = MakeAddrLValue(Location, E->getType()); diff --git a/test/CodeGenCXX/exceptions.cpp b/test/CodeGenCXX/exceptions.cpp index 4a32de024a..18a3d108dd 100644 --- a/test/CodeGenCXX/exceptions.cpp +++ b/test/CodeGenCXX/exceptions.cpp @@ -394,7 +394,11 @@ namespace test7 { // Just don't crash. namespace test8 { struct A { + // Having both of these is required to trigger the assert we're + // trying to avoid. A(const A&); + A&operator=(const A&); + ~A(); };