However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63868
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void VarDecl::Destroy(ASTContext& C) {
+ Expr *Init = getInit();
+ if (Init)
+ Init->Destroy(C);
this->~VarDecl();
C.Deallocate((void *)this);
}
VarDecl::~VarDecl() {
- delete getInit();
}
//===----------------------------------------------------------------------===//
using namespace clang;
void CXXConditionDeclExpr::Destroy(ASTContext& C) {
- getVarDecl()->Destroy(C);
+ // FIXME: Cannot destroy the decl here, because it is linked into the
+ // DeclContext's chain.
+ //getVarDecl()->Destroy(C);
delete this;
}