aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CGExpr.cpp3
-rw-r--r--test/CodeGenCXX/exceptions.cpp4
2 files changed, 6 insertions, 1 deletions
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();
};