[cfe-commits] r69956 - in /cfe/trunk/lib/Sema: Sema.h SemaDeclCXX.cpp
Anders Carlsson
andersca at mac.com
Thu Apr 23 22:16:08 PDT 2009
Author: andersca
Date: Fri Apr 24 00:16:06 2009
New Revision: 69956
URL: http://llvm.org/viewvc/llvm-project?rev=69956&view=rev
Log:
Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=69956&r1=69955&r2=69956&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Fri Apr 24 00:16:06 2009
@@ -1449,8 +1449,8 @@
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,
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=69956&r1=69955&r2=69956&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Apr 24 00:16:06 2009
@@ -1780,11 +1780,8 @@
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);
}
More information about the cfe-commits
mailing list