]> granicus.if.org Git - clang/commitdiff
Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for...
authorAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 05:23:13 +0000 (05:23 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 24 Apr 2009 05:23:13 +0000 (05:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69957 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h
lib/AST/ExprCXX.cpp
lib/Sema/SemaExprCXX.cpp

index 9d3710a2a61c72eca8a56762384898fd5004ada6..9c948f9f825e95d2cc087893cd91895020e6be2a 100644 (file)
@@ -480,7 +480,8 @@ class CXXTemporaryObjectExpr : public Expr {
   unsigned NumArgs;
 
 public:
-  CXXTemporaryObjectExpr(CXXConstructorDecl *Cons, QualType writtenTy,
+  CXXTemporaryObjectExpr(VarDecl *vd, 
+                         CXXConstructorDecl *Cons, QualType writtenTy,
                          SourceLocation tyBeginLoc, Expr **Args,
                          unsigned NumArgs, SourceLocation rParenLoc);
 
index e0a988bf669442d873f3d67df3478eafc7b4ac33..01290d94722aaae44de5e1e2e0d3e8a375cadc4f 100644 (file)
@@ -231,7 +231,8 @@ const char *CXXNamedCastExpr::getCastName() const {
   }
 }
 
-CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(CXXConstructorDecl *Cons,
+CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(VarDecl *vd,
+                                               CXXConstructorDecl *Cons,
                                                QualType writtenTy,
                                                SourceLocation tyBeginLoc, 
                                                Expr **Args,
index d3a46dc1acb684452f70485fc4924b6aa624287b..753d1e47ba38a2dcec3f943325239178101acc66 100644 (file)
@@ -128,7 +128,10 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
   if (Ty->isDependentType() ||
       CallExpr::hasAnyTypeDependentArguments(Exprs, NumExprs)) {
     exprs.release();
-    return Owned(new (Context) CXXTemporaryObjectExpr(0, Ty, TyBeginLoc,
+    
+    // FIXME: Is this correct?
+    CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, Ty);
+    return Owned(new (Context) CXXTemporaryObjectExpr(Temp, 0, Ty, TyBeginLoc,
                                                       Exprs, NumExprs,
                                                       RParenLoc));
   }
@@ -163,8 +166,10 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
       if (!Constructor)
         return ExprError();
 
+      CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, Ty);
+
       exprs.release();
-      return Owned(new (Context) CXXTemporaryObjectExpr(Constructor, Ty,
+      return Owned(new (Context) CXXTemporaryObjectExpr(Temp, Constructor, Ty,
                                                         TyBeginLoc,  Exprs,
                                                         NumExprs, RParenLoc));
     }