diff options
-rw-r--r-- | include/clang/AST/ExprCXX.h | 7 | ||||
-rw-r--r-- | lib/AST/ExprCXX.cpp | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index ed713c843b..0548a7212d 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -415,13 +415,14 @@ public: /// CXXTemporary - Represents a C++ temporary. class CXXTemporary { /// Destructor - The destructor that needs to be called. - CXXDestructorDecl *Destructor; + const CXXDestructorDecl *Destructor; - CXXTemporary(CXXDestructorDecl *destructor) + CXXTemporary(const CXXDestructorDecl *destructor) : Destructor(destructor) { } public: - static CXXTemporary *Create(ASTContext &C, CXXDestructorDecl *Destructor); + static CXXTemporary *Create(ASTContext &C, + const CXXDestructorDecl *Destructor); }; /// CXXBindTemporaryExpr - Represents binding an expression to a temporary, diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index d0032fb5e5..f757ac0a89 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -237,7 +237,7 @@ const char *CXXNamedCastExpr::getCastName() const { } CXXTemporary *CXXTemporary::Create(ASTContext &C, - CXXDestructorDecl *Destructor) { + const CXXDestructorDecl *Destructor) { // FIXME: Allocate using the ASTContext. return new CXXTemporary(Destructor); } @@ -248,7 +248,7 @@ CXXBindTemporaryExpr *CXXBindTemporaryExpr::Create(ASTContext &C, assert(SubExpr->getType()->isRecordType() && "Expression bound to a temporary must have record type!"); - return new CXXBindTemporaryExpr(Temp, SubExpr); + return new (C) CXXBindTemporaryExpr(Temp, SubExpr); } CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, VarDecl *vd, |