From 8947e5dcd0a9b872bfdf459f27da315ed2035fc5 Mon Sep 17 00:00:00 2001 From: emsr Date: Wed, 9 Jul 2014 13:33:58 +0000 Subject: libcpp/ 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net> PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped by preprocessor * lex.c (lex_raw_string ()): Do not warn about invalid suffix if skipping. (lex_string ()): Ditto. gcc/testsuite/ 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net> PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped g++.dg/cpp0x/pr58155.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212392 138bc75d-0d04-0410-961f-82ee72b054a4 --- libcpp/lex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcpp/lex.c') diff --git a/libcpp/lex.c b/libcpp/lex.c index b7836225332..9130cbcee91 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1646,7 +1646,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, if (is_macro (pfile, cur)) { /* Raise a warning, but do not consume subsequent tokens. */ - if (CPP_OPTION (pfile, warn_literal_suffix)) + if (CPP_OPTION (pfile, warn_literal_suffix) && !pfile->state.skipping) cpp_warning_with_line (pfile, CPP_W_LITERAL_SUFFIX, token->src_loc, 0, "invalid suffix on literal; C++11 requires " @@ -1775,7 +1775,7 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) if (is_macro (pfile, cur)) { /* Raise a warning, but do not consume subsequent tokens. */ - if (CPP_OPTION (pfile, warn_literal_suffix)) + if (CPP_OPTION (pfile, warn_literal_suffix) && !pfile->state.skipping) cpp_warning_with_line (pfile, CPP_W_LITERAL_SUFFIX, token->src_loc, 0, "invalid suffix on literal; C++11 requires " -- cgit v1.2.1