aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-16 05:13:48 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-16 05:13:48 +0000
commit9abf2aedae7538cfd85f3ff0898a6d14385c8e36 (patch)
treea173ddcd8f0aa57278b894e1c9917e79bb556e0f /lib/Sema/SemaInit.cpp
parent2d46eb21eb2c904831b0e9f75ab3523384c70e66 (diff)
AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index f734d9347a..ce6a99acd9 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -176,10 +176,7 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
DirectInit? IK_Direct : IK_Copy);
if (!Constructor)
return true;
- bool Elidable = (isa<CallExpr>(Init) ||
- isa<CXXTemporaryObjectExpr>(Init));
- Init = BuildCXXConstructExpr(DeclType, Constructor, Elidable, &Init, 1);
- Init = MaybeCreateCXXExprWithTemporaries(Init, /*DestroyTemps=*/true);
+ Init = BuildCXXConstructExpr(DeclType, Constructor, &Init, 1);
return false;
}