forked from OSchip/llvm-project
Small fixes to CXXTemporary and CXXBindTemporaryExpr.
llvm-svn: 72628
This commit is contained in:
parent
993a4b3080
commit
ffda606612
|
@ -415,13 +415,14 @@ public:
|
||||||
/// CXXTemporary - Represents a C++ temporary.
|
/// CXXTemporary - Represents a C++ temporary.
|
||||||
class CXXTemporary {
|
class CXXTemporary {
|
||||||
/// Destructor - The destructor that needs to be called.
|
/// Destructor - The destructor that needs to be called.
|
||||||
CXXDestructorDecl *Destructor;
|
const CXXDestructorDecl *Destructor;
|
||||||
|
|
||||||
CXXTemporary(CXXDestructorDecl *destructor)
|
CXXTemporary(const CXXDestructorDecl *destructor)
|
||||||
: Destructor(destructor) { }
|
: Destructor(destructor) { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CXXTemporary *Create(ASTContext &C, CXXDestructorDecl *Destructor);
|
static CXXTemporary *Create(ASTContext &C,
|
||||||
|
const CXXDestructorDecl *Destructor);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// CXXBindTemporaryExpr - Represents binding an expression to a temporary,
|
/// CXXBindTemporaryExpr - Represents binding an expression to a temporary,
|
||||||
|
|
|
@ -237,7 +237,7 @@ const char *CXXNamedCastExpr::getCastName() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
CXXTemporary *CXXTemporary::Create(ASTContext &C,
|
CXXTemporary *CXXTemporary::Create(ASTContext &C,
|
||||||
CXXDestructorDecl *Destructor) {
|
const CXXDestructorDecl *Destructor) {
|
||||||
// FIXME: Allocate using the ASTContext.
|
// FIXME: Allocate using the ASTContext.
|
||||||
return new CXXTemporary(Destructor);
|
return new CXXTemporary(Destructor);
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ CXXBindTemporaryExpr *CXXBindTemporaryExpr::Create(ASTContext &C,
|
||||||
assert(SubExpr->getType()->isRecordType() &&
|
assert(SubExpr->getType()->isRecordType() &&
|
||||||
"Expression bound to a temporary must have record type!");
|
"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,
|
CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, VarDecl *vd,
|
||||||
|
|
Loading…
Reference in New Issue