<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Sep 16, 2014, at 12:54 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 16, 2014 at 12:47 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5">On Sep 16, 2014, at 12:11 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 16, 2014 at 11:45 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Sep 15, 2014, at 9:47 AM, Ben Langmuir <<a href="mailto:blangmuir@apple.com" target="_blank">blangmuir@apple.com</a>> wrote:<br>
> Hi John,<br>
><br>
> This patch fixes the assertion failure I talked to you about in Objective C++ codegen.  It turned out to have nothing to do with templates.<br>
><br>
>    Fix an assertion failure trying to emit a trivial destructor in ObjC++<br>
><br>
>    If a base class declares a destructor, we will add the implicit<br>
>    destructor for the subclass in<br>
>    ActOnFields -> AddImplicitlyDeclaredMembersToClass<br>
><br>
>    But in Objective C++, we did not compute whether we have a trivial<br>
>    destructor until after that in<br>
>    CXXRecordDecl::completeDefinition()<br>
><br>
>    This was leading to a mismatch between the class, which thought it had<br>
>    no trivial destructor, and the CXXDestructorDecl, which considered<br>
>    itself trivial.<br>
<br>
</div>I feel like hasTrivialDestructor should return the right value here.  I understand (and am saddened by) the hack about not setting PlainOldData until completeDefinition, but maybe we can set/clear the rest of the bits eagerly?</blockquote><div><br></div><div>Why do we have to delay setting the PlainOldData flag?</div></div></div></div>
</blockquote></div><br></div></div><div>There is a diagnostic which wants to warn about structs that are only POD in non-ARC modes.</div></div></blockquote><div><br></div><div>Thanks, I suspected something along those lines. Perhaps we could track both properties and still perform the calculation eagerly:</div><div><br></div><div>-  bool isPOD() const { return data().PlainOldData; }</div><div>+  bool isPOD() const { return data().PlainOldData && !data().HasARCObjectMember; }<br></div><div>+  bool wouldHaveBeenPODIfItWerentForYouMeddlingKids() const { return data().PlainOldData; }</div></div></div></div>
</blockquote></div><br><div>That works for me, or we could even give it its own bit in the definition data; it’s not like we aren’t tracking a number of other things there for similar purposes.</div><div><br></div><div>John.</div></body></html>