]> granicus.if.org Git - clang/commitdiff
Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithCon...
authorAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 05:16:06 +0000 (05:16 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 05:16:06 +0000 (05:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp

index 3544324ae562b62408c50770269f0262c86fc192..b3cb5e25fb350df6fa7a7d521b1aaec72ebd7094 100644 (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, 
index 734b6ce3a0de7536293ed9dd7c0741bad506aff6..82830ef4ad6f0b8f8d5e2e69f2a20772abcc7962 100644 (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);
 }