[cxx-abi-dev] RE: [cxx-abi] [cxx-abi-dev] Mangling unary plus

Mark Mitchell mark at codesourcery.com
Wed Oct 9 21:23:49 UTC 2002



--On Wednesday, October 09, 2002 01:55:16 PM -0700 "Nelson, Clark" 
<clark.nelson at intel.com> wrote:

>> So, I do not think we have a choice; I think we need to specify "ps"
>> for unary plus.
>>
>> Thoughts?
>
> There is at least one obvious alternative to consider: is it really
> necessary to encode unary plus as part of an expression? Can someone give
> an example where simply ignoring the unary plus would cause a problem?

First, note that not encoding unary plus at all would require changing
all of the compilers, so it's not better than going with either "pl"
or "ps" from that perspective.

Unary plus does cause integral promotions, for example, so:

 +'a'

has type "int", not type "char".

Also, inside a sizeof-expression, unary plus might indicate an
overloaded operator.

-- 
Mark Mitchell                mark at codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the cxx-abi-dev mailing list