From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29772 invoked by alias); 3 Dec 2012 22:57:23 -0000 Received: (qmail 29718 invoked by uid 48); 3 Dec 2012 22:57:01 -0000 From: "3dw4rd at verizon dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55582] New: [C++11] Unable to define string user-defined literal without leading underscore. Date: Mon, 03 Dec 2012 22:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: 3dw4rd at verizon dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00301.txt.bz2 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