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

John McCall rjmccall at apple.com
Wed Aug 18 19:09:16 UTC 2010


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.

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

John.


More information about the cxx-abi-dev mailing list