public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55582] New: [C++11] Unable to define string user-defined literal without leading underscore.
@ 2012-12-03 22:57 3dw4rd at verizon dot net
  2012-12-04  0:35 ` [Bug c++/55582] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: 3dw4rd at verizon dot net @ 2012-12-03 22:57 UTC (permalink / raw)
  To: gcc-bugs


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: unassigned@gcc.gnu.org
        ReportedBy: 3dw4rd@verizon.net


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
aww@google.com 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-26 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 22:57 [Bug c++/55582] New: [C++11] Unable to define string user-defined literal without leading underscore 3dw4rd at verizon dot net
2012-12-04  0:35 ` [Bug c++/55582] " redi at gcc dot gnu.org
2012-12-05 13:19 ` 3dw4rd at verizon dot net
2012-12-05 13:23 ` paolo.carlini at oracle dot com
2012-12-05 13:45 ` 3dw4rd at verizon dot net
2012-12-09  0:37 ` pinskia at gcc dot gnu.org
2013-02-14  2:56 ` emsr at gcc dot gnu.org
2013-02-26 18:27 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).