]> gcc.gnu.org Git - gcc.git/commit
c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]
authorMarek Polacek <polacek@redhat.com>
Mon, 17 Jan 2022 21:26:01 +0000 (16:26 -0500)
committerMarek Polacek <polacek@redhat.com>
Mon, 17 Jan 2022 21:26:01 +0000 (16:26 -0500)
commit2c4b5bd4440292eca51de1f09ccce0d139ab981e
tree21c3977cb046d0baaa534c1df9528811899b602b
parent6830d3bd9ea06cf005f679fc1ebe490cb05b0696
c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]

I'm tired of seeing

cp/parser.c:15923:55: warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
cp/parser.c:15925:57: warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]

every time I compile cp/parser.c, which happens...a lot.  I'd like my
compilation to be free of warnings, otherwise I'm going to miss some
important ones.

"decl-specifiers" is a C++ grammar term; it is not actual code, so
should not be wrapped with %< %>.  I hope we can accept it as an exception
in check_tokens.

It was surrounded by %< %> in cp_parser_decl_specifier_seq, so fix that.

In passing, fix a misspelling in missspellings.

PR c++/103758

gcc/c-family/ChangeLog:

* c-format.c (check_tokens): Accept "decl-specifier*".

gcc/cp/ChangeLog:

* parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
with %qD.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-condition.C: Adjust dg-error.

(cherry picked from commit bb936163e28fdbe1a751c55d5e5975e036322a3d)
gcc/c-family/c-format.c
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
This page took 0.111823 seconds and 6 git commands to generate.