[rfh][pr17996] How to implicitly use thiscall on pointer to member functions

Reid Kleckner rnk at google.com
Tue Nov 19 13:51:16 PST 2013


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.

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.


On Tue, Nov 19, 2013 at 1:38 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> The attached patch fixes the testcase in the PR, but unfortunately it
> causes assertion failures deep inside template instantiation when
> processing
>
> struct A {};
> template<typename Fn> struct X {
>   typedef Fn A::*p;
> };
> X<void ()>::p;
>
> Since the first pattern shows up during a bootstrap and the second one
> doesn't, I have just applied this patch locally to try to find the
> next bug for now.
>
> If it is clear to anyone what the assert during the transformation is
> all about, please let me know I will try to fix this bug too.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131119/d4314f94/attachment.html>


More information about the cfe-commits mailing list