Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.

llvm-svn: 69956
This commit is contained in:
Anders Carlsson 2009-04-24 05:16:06 +00:00
parent 1011c9a827
commit e500faf8c8
2 changed files with 4 additions and 7 deletions

View File

@ -1449,8 +1449,8 @@ public:
SourceLocation *CommaLocs,
SourceLocation RParenLoc);
/// InitializeVarWithConstructor - Creates an implicit
/// CXXTemporaryObjectExpr and sets it as the passed in VarDecl initializer.
/// InitializeVarWithConstructor - Creates an CXXConstructExpr
/// and sets it as the initializer for the the passed in VarDecl.
void InitializeVarWithConstructor(VarDecl *VD,
CXXConstructorDecl *Constructor,
QualType DeclInitType,

View File

@ -1780,11 +1780,8 @@ void Sema::InitializeVarWithConstructor(VarDecl *VD,
CXXConstructorDecl *Constructor,
QualType DeclInitType,
Expr **Exprs, unsigned NumExprs) {
Expr *Temp =
new (Context) CXXTemporaryObjectExpr(Constructor, DeclInitType,
SourceLocation(),
Exprs, NumExprs,
SourceLocation());
Expr *Temp = CXXConstructExpr::Create(Context, VD, DeclInitType, Constructor,
false, Exprs, NumExprs);
VD->setInit(Temp);
}