[cxx-abi-dev] Mangling 'this' in trailing-return-type

John McCall rjmccall at apple.com
Mon Jul 4 20:23:53 UTC 2011


On Jul 4, 2011, at 7:32 AM, Jason Merrill wrote:
> On 07/01/2011 11:44 PM, Jason Merrill wrote:
>> Since DR 1207, we need to have a representation for uses of 'this' in a
>> trailing-return-type. Perhaps "fpT"?
> 
> So,
> 
> struct B
> {
>  template <class U> U f();
> };
> 
> struct A
> {
>  B b;
>  // implicitly rewritten to (*this).b.f<U>()
>  // _ZN1A1fIiEEDTcldtdtdefpT1b1fIT_EEEv
>  template <class U> auto f() -> decltype (b.f<U>());
>  // _ZN1A1gIiEEDTcldtptfpT1b1fIT_EEEv
>  template <class U> auto g() -> decltype (this->b.f<U>());
> };

This looks good to me.

John.



More information about the cxx-abi-dev mailing list