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

Jason Merrill jason at redhat.com
Wed Jan 4 18:22:31 UTC 2012


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?

Thanks,
Jason



More information about the cxx-abi-dev mailing list