]> granicus.if.org Git - clang/commitdiff
An initialization does not alias.
authorJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 05:38:08 +0000 (05:38 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 05:38:08 +0000 (05:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138624 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
test/CodeGenCXX/exceptions.cpp

index 1ed24ccd65fafd2254d3d31736722713907df915..88536e2acd007d5e3c03e1f46a792a22b5867d33 100644 (file)
@@ -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());
index 4a32de024a347199889a59202f80a86834036d0f..18a3d108dd34b253097be58f293bdf8cd835d4f0 100644 (file)
@@ -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();
   };