AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.
llvm-svn: 79176
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index f734d93..ce6a99a 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -176,10 +176,7 @@
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;
}