From mjh at edg.com Tue Jul 9 18:12:51 2013 From: mjh at edg.com (Mike Herrick) Date: Tue, 9 Jul 2013 14:12:51 -0400 Subject: [cxx-abi-dev] Literal operator functions with 'li' In-Reply-To: <4DEB3A41.5040408@csclub.uwaterloo.ca> References: <4DEB3A41.5040408@csclub.uwaterloo.ca> Message-ID: <63DEC41C-9231-4E0B-A178-EA7C3FFAFF86@edg.com> Hi, 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). On Jun 5, 2011, at 4:11 AM, Sean Hunt wrote: > Hi, > > I don't know where to find the document to patch against, but I'd like to suggest that the line > > ::= li # "" > > be added somewhere amongst the productions for 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 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. Thanks, Mike Herrick Edison Design Group From richardsmith at google.com Tue Jul 9 20:25:29 2013 From: richardsmith at google.com (Richard Smith) Date: Tue, 9 Jul 2013 13:25:29 -0700 Subject: [cxx-abi-dev] Literal operator functions with 'li' In-Reply-To: <63DEC41C-9231-4E0B-A178-EA7C3FFAFF86@edg.com> References: <4DEB3A41.5040408@csclub.uwaterloo.ca> <63DEC41C-9231-4E0B-A178-EA7C3FFAFF86@edg.com> Message-ID: On Tue, Jul 9, 2013 at 11:12 AM, Mike Herrick wrote: > Hi, > > 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). > > On Jun 5, 2011, at 4:11 AM, Sean Hunt wrote: > > > Hi, > > > > I don't know where to find the document to patch against, but I'd like > to suggest that the line > > > > ::= li # "" > > > > be added somewhere amongst the productions for 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 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. Modeling a UDL as a call to the corresponding literal operator is an accident of Clang's implementation rather than a deliberate choice of mangling, but it seems reasonable to me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjmccall at apple.com Wed Jul 10 09:42:26 2013 From: rjmccall at apple.com (John McCall) Date: Wed, 10 Jul 2013 02:42:26 -0700 Subject: [cxx-abi-dev] Literal operator functions with 'li' In-Reply-To: <63DEC41C-9231-4E0B-A178-EA7C3FFAFF86@edg.com> References: <4DEB3A41.5040408@csclub.uwaterloo.ca> <63DEC41C-9231-4E0B-A178-EA7C3FFAFF86@edg.com> Message-ID: <87578987-0E1D-4A8D-AD07-7730DEED959A@apple.com> On Jul 9, 2013, at 11:12 AM, Mike Herrick 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 wrote: > >> Hi, >> >> I don't know where to find the document to patch against, but I'd like to suggest that the line >> >> ::= li # "" >> >> be added somewhere amongst the productions for 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 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.