<div dir="ltr">On Thu, Mar 28, 2013 at 11:00 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mar 27, 2013, at 6:38 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
> - Split function member pointer case from data case.<br>
><br>
> Hi rjmccall,<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D568" target="_blank">http://llvm-reviews.chandlerc.com/D568</a><br>
><br>
> CHANGE SINCE LAST DIFF<br>
> <a href="http://llvm-reviews.chandlerc.com/D568?vs=1406&id=1416#toc" target="_blank">http://llvm-reviews.chandlerc.com/D568?vs=1406&id=1416#toc</a><br>
<br>
</div>+ RD->addAttr(::new (Context) UnspecifiedInheritanceAttr(<br>
+ RD->getSourceRange(), Context));<br>
<br>
For sanity's sake, you need to add this to all the declarations. RD here<br>
is likely to be only the first redeclaration, so I suspect you'll get this wrong<br>
if you have:<br>
<br>
struct A; // this will get the UnspecifiedInheritanceAttr<br>
struct A; // but this won't<br>
int A::*mptr = 0; // this should have size 12<br>
struct A { // this becomes the RD in the type but has failed to inherit the attribute<br>
int x, y, z;<br>
};<br>
int A::*mptr2 = 0; // this should have size 12, but probably has size 4<br></blockquote><div><br></div><div style>OK, I thought I had this case tested, but adding the extra redecl does what you suspected. Fixed by iterating the redecls.</div>
</div></div></div>