<div dir="ltr">I'm pretty sure the problem here is that we lose the typedef sugar when we do this.  The correct solution that I promised to implement and then punted on was to add an some kind of sugar node that we layer on top of the existing type to perform the calling convention adjustment, similar to how DecayedType works.  That is the correct Richard Approved™ design.<div>
<br></div><div>We could invent a new implicit CC-adjusting node, or add a notion of an "implicit" AttributedType, which looks like a __thiscall annotation to the rest of Sema.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Nov 19, 2013 at 1:38 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The attached patch fixes the testcase in the PR, but unfortunately it<br>
causes assertion failures deep inside template instantiation when<br>
processing<br>
<br>
struct A {};<br>
template<typename Fn> struct X {<br>
  typedef Fn A::*p;<br>
};<br>
X<void ()>::p;<br>
<br>
Since the first pattern shows up during a bootstrap and the second one<br>
doesn't, I have just applied this patch locally to try to find the<br>
next bug for now.<br>
<br>
If it is clear to anyone what the assert during the transformation is<br>
all about, please let me know I will try to fix this bug too.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>