summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-22 21:01:02 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-22 21:01:02 +0000
commit07ed93f378a8868c9a7c04ca7ae685b85c55e5ea (patch)
treeb3bf117c0c0491cd2af870b5383fc5ac4b4fc440 /lib/CodeGen/CGExprCXX.cpp
parent6802027338b8af1d54ba94d7ed9722f1b327b645 (diff)
downloadclang-07ed93f378a8868c9a7c04ca7ae685b85c55e5ea.tar.gz
Patch fixes miscompile with non-trivial copy constructors and
statement expressions, //rdar: //8540501 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 2a88d33997..3cebfe7f88 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -299,6 +299,7 @@ CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E,
assert(getContext().hasSameUnqualifiedType(E->getType(),
E->getArg(0)->getType()));
if (E->getArg(0)->isTemporaryObject(getContext(), CD->getParent())) {
+ Dest.setCtorExpr(const_cast<CXXConstructExpr*>(E));
EmitAggExpr(E->getArg(0), Dest);
return;
}