diff options
author | Martin Liska <mliska@suse.cz> | 2022-10-15 15:32:39 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-10-15 15:32:39 +0200 |
commit | 2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9 (patch) | |
tree | b118381a0a883a762ddd56c0e91608d937ee8bdf /libcpp/lex.cc | |
parent | bd21c04269deded2c7476ceca1100a26f28ea526 (diff) | |
parent | baeec7cc83b19b46d1c73523f06efa7ea2b30390 (diff) | |
download | gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.zip gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.tar.gz gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'libcpp/lex.cc')
-rw-r--r-- | libcpp/lex.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libcpp/lex.cc b/libcpp/lex.cc index a429a3d..cc12a52d 100644 --- a/libcpp/lex.cc +++ b/libcpp/lex.cc @@ -2007,7 +2007,8 @@ name_p (cpp_reader *pfile, const cpp_string *string) static void warn_about_normalization (cpp_reader *pfile, const cpp_token *token, - const struct normalize_state *s) + const struct normalize_state *s, + bool identifier) { if (CPP_OPTION (pfile, warn_normalize) < NORMALIZE_STATE_RESULT (s) && !pfile->state.skipping) @@ -2043,7 +2044,7 @@ warn_about_normalization (cpp_reader *pfile, if (NORMALIZE_STATE_RESULT (s) == normalized_C) cpp_warning_at (pfile, CPP_W_NORMALIZE, &rich_loc, "`%.*s' is not in NFKC", (int) sz, buf); - else if (CPP_OPTION (pfile, cplusplus)) + else if (identifier && CPP_OPTION (pfile, xid_identifiers)) cpp_pedwarning_at (pfile, CPP_W_NORMALIZE, &rich_loc, "`%.*s' is not in NFC", (int) sz, buf); else @@ -3839,7 +3840,7 @@ _cpp_lex_direct (cpp_reader *pfile) struct normalize_state nst = INITIAL_NORMALIZE_STATE; result->type = CPP_NUMBER; lex_number (pfile, &result->val.str, &nst); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, false); break; } @@ -3888,7 +3889,7 @@ _cpp_lex_direct (cpp_reader *pfile) result->val.node.node = lex_identifier (pfile, buffer->cur - 1, false, &nst, &result->val.node.spelling); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, true); } /* Convert named operators to their proper types. */ @@ -4101,7 +4102,7 @@ _cpp_lex_direct (cpp_reader *pfile) struct normalize_state nst = INITIAL_NORMALIZE_STATE; result->type = CPP_NUMBER; lex_number (pfile, &result->val.str, &nst); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, false); } else if (*buffer->cur == '.' && buffer->cur[1] == '.') buffer->cur += 2, result->type = CPP_ELLIPSIS; @@ -4192,7 +4193,7 @@ _cpp_lex_direct (cpp_reader *pfile) result->type = CPP_NAME; result->val.node.node = lex_identifier (pfile, base, true, &nst, &result->val.node.spelling); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, true); break; } |