diff options
author | Anders Carlsson <andersca@mac.com> | 2009-04-24 05:16:06 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-04-24 05:16:06 +0000 |
commit | 49d44018436761c0cfdda80d609b7dcdf8431064 (patch) | |
tree | 122fa4b874f009c9a287febc25b4eb9387c3b64e | |
parent | 76b329177a0bdf05641f74705692a59733090c53 (diff) |
Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69956 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/Sema.h | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 3544324ae5..b3cb5e25fb 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -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, diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 734b6ce3a0..82830ef4ad 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -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); } |