Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.
llvm-svn: 69956
This commit is contained in:
parent
1011c9a827
commit
e500faf8c8
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue