This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Since the fix for PR c++/80955 any suffix on a string literal that begins with an underscore is assumed to be a user-defined literal suffix, not a macro. This assumption is invalid for a suffix beginning with two underscores, because such names are reserved and can't be used for UDLs anyway. Checking for exactly one underscore restores support for macro expansion in cases like "File: "__FILE__ or "Date: "__DATE__ (which are formally ill-formed but accepted with a warning, as a conforming extension). gcc/testsuite: PR preprocessor/84517 * g++.dg/cpp0x/udlit-macros.C: Expect a warning for ""__FILE__. libcpp: PR preprocessor/84517 * lex.c (is_macro_not_literal_suffix): New function. (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to decide when to issue -Wliteral-suffix warnings. Tested powerpc64le-linux, OK for trunk?
Attachment:
patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |