http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58072

--- Comment #1 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Created attachment 30604
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30604&action=edit
Patch c_parse_error to catch and describe user-defined literal tokens
explicitly.


gcc/c-family:

2013-08-03  Ed Smith-Rowland  <3dw...@verizon.net>

    PR c++/58072
    * c-common.c (c_parse_error): Catch user-defined literal tokens and
    provide useful error strings.


Waiting for testing because I'm sure there will be testsuite fallout.

We get this:
ed@bad-horse:~$ ./bin_literal/bin/g++ -fdiagnostics-color -std=c++1y blah.cpp
-o blah
blah.cpp:6:8: error: expected unqualified-id before user-defined character
literal
 extern 'c'void*blah(void*);
        ^
blah.cpp:7:8: error: expected unqualified-id before user-defined character
literal
 extern L'c'void*Lblah(void*);
        ^
blah.cpp:8:8: error: expected unqualified-id before user-defined character
literal
 extern u'c'void*ublah(void*);
        ^
blah.cpp:9:8: error: expected unqualified-id before user-defined character
literal
 extern U'c'void*Ublah(void*);
        ^
blah.cpp:11:8: error: expected unqualified-id before user-defined string
literal
 extern "c"void*strblah(void*);
        ^
blah.cpp:12:8: error: expected unqualified-id before user-defined string
literal
 extern L"c"void*Lstrblah(void*);
        ^
blah.cpp:13:8: error: expected unqualified-id before user-defined string
literal
 extern u"c"void*ustrblah(void*);
        ^
blah.cpp:14:8: error: expected unqualified-id before user-defined string
literal
 extern U"c"void*Ustrblah(void*);
        ^
blah.cpp:15:8: error: expected unqualified-id before user-defined string
literal
 extern u8"c"void*u8strblah(void*);
        ^
blah.cpp:17:8: error: expected unqualified-id before numeric constant
 extern 123void*ULLblah(void*);
        ^
blah.cpp:18:8: error: expected unqualified-id before numeric constant
 extern 123.456void*Ldblblah(void*);
        ^

Reply via email to