aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/Sema.h1
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
3 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 32f4ce0732..710e7d35c4 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -1899,7 +1899,6 @@ public:
/// and sets it as the initializer for the the passed in VarDecl.
bool InitializeVarWithConstructor(VarDecl *VD,
CXXConstructorDecl *Constructor,
- QualType DeclInitType,
MultiExprArg Exprs);
/// BuildCXXConstructExpr - Creates a complete call to a constructor,
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 48b5c2838e..5e433de3bb 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3466,7 +3466,7 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl,
else {
// FIXME: Cope with initialization of arrays
if (!Constructor->isTrivial() &&
- InitializeVarWithConstructor(Var, Constructor, InitType,
+ InitializeVarWithConstructor(Var, Constructor,
move_arg(ConstructorArgs)))
Var->setInvalidDecl();
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 46e2a7b0e1..4c7705b815 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3154,10 +3154,9 @@ Sema::BuildCXXTemporaryObjectExpr(CXXConstructorDecl *Constructor,
bool Sema::InitializeVarWithConstructor(VarDecl *VD,
CXXConstructorDecl *Constructor,
- QualType DeclInitType,
MultiExprArg Exprs) {
OwningExprResult TempResult =
- BuildCXXConstructExpr(VD->getLocation(), DeclInitType, Constructor,
+ BuildCXXConstructExpr(VD->getLocation(), VD->getType(), Constructor,
move(Exprs));
if (TempResult.isInvalid())
return true;
@@ -3262,7 +3261,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
RealDecl->setInvalidDecl();
else {
VDecl->setCXXDirectInitializer(true);
- if (InitializeVarWithConstructor(VDecl, Constructor, DeclInitType,
+ if (InitializeVarWithConstructor(VDecl, Constructor,
move_arg(ConstructorArgs)))
RealDecl->setInvalidDecl();
FinalizeVarWithDestructor(VDecl, DeclInitType);