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,
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);
}