Index: gcc/testsuite/g++.dg/cpp0x/udlit-macros.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/udlit-macros.C (revision 0) +++ gcc/testsuite/g++.dg/cpp0x/udlit-macros.C (working copy) @@ -0,0 +1,7 @@ +// PR c++/80955 +// { dg-do compile { target c++11 } } + +using size_t = decltype(sizeof(0)); +#define _zero +int operator""_zero(const char*, size_t) { return 0; } +int main() { return ""_zero; } Index: libcpp/lex.c =================================================================== --- libcpp/lex.c (revision 253775) +++ libcpp/lex.c (working copy) @@ -2001,8 +2001,11 @@ /* If a string format macro, say from inttypes.h, is placed touching a string literal it could be parsed as a C++11 user-defined string literal thus breaking the program. - Try to identify macros with is_macro. A warning is issued. */ - if (is_macro (pfile, cur)) + Try to identify macros with is_macro. A warning is issued. + Don't do this for a user-defined literal, i.e. an + empty string followed by an identifier. + For an empty string "", (cur-base)==2. Bug 80955 */ + if (is_macro (pfile, cur) && ((cur-base) != 2)) { /* Raise a warning, but do not consume subsequent tokens. */ if (CPP_OPTION (pfile, warn_literal_suffix) && !pfile->state.skipping)