Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69957 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2009-04-24 05:23:13 +00:00
Родитель 49d4401843
Коммит 26de54983e
3 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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,

Просмотреть файл

@ -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));
}