From 642a75f883e644bcfbb82e7af0313776ad1ce33c Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 28 Apr 2011 02:15:35 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130372 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGClass.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/CodeGen/CGClass.cpp') diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 2789bb2c9d..2cb554902e 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -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); } -- cgit v1.2.3-18-g5258