[cfe-commits] r72628 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/AST/ExprCXX.cpp
Anders Carlsson
andersca at mac.com
Sat May 30 13:34:37 PDT 2009
Author: andersca
Date: Sat May 30 15:34:37 2009
New Revision: 72628
URL: http://llvm.org/viewvc/llvm-project?rev=72628&view=rev
Log:
Small fixes to CXXTemporary and CXXBindTemporaryExpr.
Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/lib/AST/ExprCXX.cpp
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=72628&r1=72627&r2=72628&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Sat May 30 15:34:37 2009
@@ -415,13 +415,14 @@
/// 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,
Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=72628&r1=72627&r2=72628&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Sat May 30 15:34:37 2009
@@ -237,7 +237,7 @@
}
CXXTemporary *CXXTemporary::Create(ASTContext &C,
- CXXDestructorDecl *Destructor) {
+ const CXXDestructorDecl *Destructor) {
// FIXME: Allocate using the ASTContext.
return new CXXTemporary(Destructor);
}
@@ -248,7 +248,7 @@
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,
More information about the cfe-commits
mailing list