]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: add missing -Wc++??-extensions checks
authorJason Merrill <jason@redhat.com>
Tue, 27 Aug 2024 17:14:45 +0000 (13:14 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 28 Aug 2024 09:52:12 +0000 (05:52 -0400)
commit7f4f1bb29a47fbe63a15dda8acfe247b2e934959
treef550f01e78364b28c43bbe79606bc108ec69f97b
parent0beac1db38855eae0f71fa982ed05069d3873a9c
c++: add missing -Wc++??-extensions checks

The pedwarns for each of these features should be silenced by
the appropriate -Wno-c++??-extensions.

The handle_pragma_diagnostic_impl change is necessary so that we handle
-Wc++23-extensions early so it's available to interpret_float while lexing.

gcc/c-family/ChangeLog:

* c-pragma.cc (handle_pragma_diagnostic_impl): Also handle
-Wc++23-extensions early.
* c-lex.cc (interpret_float): Use -Wc++23-extensions for extended
floating point literal pedwarn.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_simple_type_specifier): Use
-Wc++20-extensions for auto parameter pedwarn.
* pt.cc (do_decl_instantiation, do_type_instantiation): Use
-Wc++11-extensions for 'extern template'.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/extern_template-7.C: New test.
* g++.dg/cpp23/ext-floating19.C: New test.
* g++.dg/cpp2a/abbrev-fn1.C: New test.
gcc/c-family/c-lex.cc
gcc/c-family/c-pragma.cc
gcc/cp/parser.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/extern_template-7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp23/ext-floating19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/abbrev-fn1.C [new file with mode: 0644]