<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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sep 15, 2014, at 9:47 AM, Ben Langmuir <<a href="mailto:blangmuir@apple.com">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></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>