On Fri, May 30, 2014 at 12:28 PM, Alp Toker <[email protected]> wrote: > On 30/05/2014 19:59, Hans Wennborg wrote: >> >> --- cfe/trunk/lib/CodeGen/CGClass.cpp (original) >> +++ cfe/trunk/lib/CodeGen/CGClass.cpp Fri May 30 11:59:42 2014 >> @@ -1425,8 +1425,8 @@ namespace { >> /// in reverse order of their construction. >> void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, >> CXXDtorType DtorType) { >> - assert(!DD->isTrivial() && >> - "Should not emit dtor epilogue for trivial dtor!"); >> + assert((!DD->isTrivial() || DD->hasAttr<DLLExportAttr>()) && >> + "Should not emit dtor epilogue for non-exported trivial dtor!"); >> > > Instead of changing all these isTrivial() checks, did you consider making > special members under the DllExport attribute non-trivial e.g. from within > SpecialMemberIsTrivial()? > > Seems to work and have more consistent semantics if that's what we're > going for. >
Semantically, the destructor is still trivial. We should never emit calls to it. We just need to emit a definition for compatibility with MSVC.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
