diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 34d1c8d984..a575dbc463 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -1808,9 +1808,12 @@ void CodeGenFunction::EmitDtorEpilogue(const CXXDestructorDecl *DD, } // If we have a deleting destructor, emit a call to the delete operator. - if (DtorType == Dtor_Deleting) + if (DtorType == Dtor_Deleting) { + assert(DD->getOperatorDelete() && + "operator delete missing - EmitDtorEpilogue"); EmitDeleteCall(DD->getOperatorDelete(), LoadCXXThis(), getContext().getTagDeclType(ClassDecl)); + } } void CodeGenFunction::SynthesizeDefaultDestructor(const CXXDestructorDecl *Dtor,