[cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules

David Vandevoorde daveed at edg.com
Wed Aug 18 19:47:03 UTC 2010


On Aug 18, 2010, at 3:09 PM, John McCall wrote:

> 
> On Aug 18, 2010, at 11:50 AM, Jason Merrill wrote:
> 
>> On 08/18/2010 02:30 PM, John McCall wrote:
>>> On Aug 11, 2010, at 10:57 AM, David Vandevoorde wrote:
>>>> <SFINAE_diffs-3>
>>> 
>>> We should probably specify what happens when mangling an operator of
>>> unknown arity, i.e. when mangling the signature for
>>> template <class T> void f(decltype(&T::operator+));
>>> I think all the existing frontends mangle this as the binary operator in
>>> all four cases (+ - * &), but it would be good to spell this out in the ABI.
>> 
>> At the end of 5.1.5:
>> 
>> "If the qualified name refers to an operator for which both unary and binary manglings are available, the mangling chosen is the mangling for the binary version."
> 
> Aha, missed that, thank you.  I think this resolves my third question as well, since that's inherently a qualified name.  To be pedantic, I think this doesn't cover unresolved-name cases like
>  template <class T> void f(decltype(T::foo(&operator+)));
> but the intent is obvious.

Actually, note that Jason's quote is modified by my proposed patch:

! If the <code><unresolved-name></code> refers to an operator for
! which both unary and binary manglings are available, the mangling
! chosen is the mangling for the binary version.
! For example:
! <code><pre>
!           template<class T> auto f(T p)->decltype(&T::operator-);
!             // The return type in the mangling of the template signature
!             // is encoded as "DTadsrT_onmiE".
! </pre></code>

which should handle that case too.

	Daveed

> 
> Is there anything specifically saying that we mangle operator names based on the deduced arity from a call site?






More information about the cxx-abi-dev mailing list