http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55582
Bug #: 55582
Summary: [C++11] Unable to define string user-defined literal
without leading underscore.
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
This bug is brought to you by the letter 's'.
Now that PR54413 is fixed I tried to implement the user-defined literal
suffixes proposed by Peter Sommerlad in his paper n3468.pdf
I ran into trouble with the string literal suffix 's'. The hangup is the
-Wliteral-suffix flag which was added for PR52538 in 2012-04-27 by Ollie Wild
[email protected] which treats any character or string suffix that does *not*
start with '_' as a separate token. This to fix broken code with printing
macros in inttype.h.
With the paper presented by Peter Sommerlad above, the suffix 's' is proposed
to create std::string, etc. This wont work with the tokenization introduced
for PR52538.
Basically, I think some deal needs to be struck and could be struck here.
I see five possibilities:
* let the letter 's' go by as a user-defined literal (with appropriate
comment)
* If the macros in are all upper case we could let lower case suffixes go.
* We could try to figure out if a suffix has been defined as a literal and let
those through.
* All the inttype.h macros start with PRI or SCN AFAICS. Just split those.
* This problem is above my pay grade.
Test case is forthcoming.
Ideas?
Ed