<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 30, 2014 at 12:28 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 30/05/2014 19:59, Hans Wennborg wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--- cfe/trunk/lib/CodeGen/CGClass.<u></u>cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGClass.<u></u>cpp Fri May 30 11:59:42 2014<br>
@@ -1425,8 +1425,8 @@ namespace {<br>
  /// in reverse order of their construction.<br>
  void CodeGenFunction::<u></u>EnterDtorCleanups(const CXXDestructorDecl *DD,<br>
                                          CXXDtorType DtorType) {<br>
-  assert(!DD->isTrivial() &&<br>
-         "Should not emit dtor epilogue for trivial dtor!");<br>
+  assert((!DD->isTrivial() || DD->hasAttr<DLLExportAttr>()) &&<br>
+         "Should not emit dtor epilogue for non-exported trivial dtor!");<br>
</blockquote>
<br></div></div>
Instead of changing all these isTrivial() checks, did you consider making special members under the DllExport attribute non-trivial e.g. from within SpecialMemberIsTrivial()?<br>
<br>
Seems to work and have more consistent semantics if that's what we're going for.<br></blockquote><div><br></div><div>Semantically, the destructor is still trivial.  We should never emit calls to it.  We just need to emit a definition for compatibility with MSVC.</div>
</div></div></div>