When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor. This normally isn't required, because the destructor should have been marked as part of the declaration of the local, but it's necessary when the variable is a parameter because it's the call sites that are responsible for those destructors. llvm-svn: 130372
This commit is contained in:
@@ -1305,6 +1305,7 @@ void CodeGenFunction::PushDestructorCleanup(QualType T, llvm::Value *Addr) {
|
||||
if (ClassDecl->hasTrivialDestructor()) return;
|
||||
|
||||
const CXXDestructorDecl *D = ClassDecl->getDestructor();
|
||||
assert(D && D->isUsed() && "destructor not marked as used!");
|
||||
PushDestructorCleanup(D, Addr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user