[cxx-abi-dev] Mangling of function-to-pointer conversion

John McCall rjmccall at apple.com
Fri Jan 6 02:53:47 UTC 2012


On Jan 4, 2012, at 10:22 AM, Jason Merrill wrote:
> On 01/04/2012 11:42 AM, Mike Herrick wrote:
>>> template<typename T>  int cmp1(T a, T b);
>>> int cmp2(char a, char b);
>>> template<typename T, int (*cmp)(T, T)> struct A { };
>>> template<typename T>  void f (A<T,cmp1> &);
>>> template<typename T>  void f (A<T,cmp2> &);
>>> void g()
>>> {
>>>  A<char,cmp1>  a;
>>>  f(a);
>>>  A<char,cmp2>  a2;
>>>  f(a2);
>>> }
>>> 
>> We agree that <unresolved-name> is the way to go here.
> 
> For the first f<char>, or both?  For the two f<char>, I think we should produce
> 
> _Z1fIcEvR1AIT_X4cmp1EE
> _Z1fIcEvR1AIT_L_Z4cmp2ccEE
> 
> Do you agree?

I agree with this.

John.



More information about the cxx-abi-dev mailing list