[cxx-abi-dev] Mangling for noexcept operator

David Vandevoorde daveed at edg.com
Tue Sep 4 18:30:32 UTC 2012


On Sep 4, 2012, at 2:17 PM, John McCall wrote:

> On Sep 4, 2012, at 6:39 AM, Mike Herrick wrote:
>> We don't seem to have a mangling for the new noexcept operator.  
>> 
>> How's this:
>> 
>> <operator-name> ::= nx		# noexcept (an expression)
>> 
>> For example:
>> 
>> void f(int) noexcept;
>> void f(float) throw (int);
>> template <class T> auto g(T p) -> decltype((int (*)[noexcept(f(p))])0);
>> int main() {
>>   g(1);
>> }
>> 
>> Which would provide a mangled name of: _Z1gIiEDTcvPAnxcl1ffp_E_iLi0EET_ for g.
> 
> This seems like a fine mangling, but it shouldn't be an <operator-name>.
> Let's just do:
>  <expression> ::= nx <expression>

It would be odd not to follow the pattern of sizeof and alignof here, no?

(I can kind of see an argument to distinguish the "operators" that cannot be the basis of a <base-unresolved-name>, but I'm not sure it's worth the complication.)

	Daveed



More information about the cxx-abi-dev mailing list