diff options
author | John McCall <rjmccall@apple.com> | 2011-08-26 05:38:08 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-08-26 05:38:08 +0000 |
commit | a8a39bc3465a4bb890b4250573d8cf7a99c12666 (patch) | |
tree | d4dab59c9a38b2b3cd535f66d730a376ccefbab1 | |
parent | c66d50d1a2279831d59f05d3d9834771b792697a (diff) | |
download | bcm5719-llvm-a8a39bc3465a4bb890b4250573d8cf7a99c12666.tar.gz bcm5719-llvm-a8a39bc3465a4bb890b4250573d8cf7a99c12666.zip |
An initialization does not alias.
llvm-svn: 138624
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 3 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/exceptions.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 1ed24ccd65f..88536e2acd0 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/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/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp index 4a32de024a3..18a3d108dd3 100644 --- a/clang/test/CodeGenCXX/exceptions.cpp +++ b/clang/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(); }; |