[cxx-abi-dev] Literal operator functions with 'li<length, ID>'

John McCall rjmccall at apple.com
Wed Jul 10 09:42:26 UTC 2013


On Jul 9, 2013, at 11:12 AM, Mike Herrick <mjh at edg.com> wrote:
> It appears that this patch for user-defined literals hasn't been applied to the document (though it is used by at least g++ and clang).

Got it, thanks.

> On Jun 5, 2011, at 4:11 AM, Sean Hunt <scshunt at csclub.uwaterloo.ca> wrote:
> 
>> Hi,
>> 
>> I don't know where to find the document to patch against, but I'd like to suggest that the line
>> 
>> 		  ::= li <source-name>	# "" <source-name>
>> 
>> be added somewhere amongst the productions for <operator-name> in 5.1.3 since it's not yet in the document.
> 
> Additionally, how about a case like this:
> 
> int operator "" _w(const char*);
> template <class T> auto f(T p1) -> decltype(123_w, p1);
> int main() {
>  f(456_w);
> }
> 
> Clang gives a mangling of _Z1fIiEDTcmclL_Zli2_wPKcELA4_cEEfp_ET_, but g++ aborts on this case.  I don't believe I've seen a discussion of this.

I think this is probably the obvious mangling for this, but I'll wait for consensus.

John.


More information about the cxx-abi-dev mailing list