From 7f4f1bb29a47fbe63a15dda8acfe247b2e934959 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 27 Aug 2024 13:14:45 -0400 Subject: 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/cp/parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/parser.cc') diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index a722641..918072d 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -20527,7 +20527,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, error_at (token->location, "use of % in template argument"); else if (!flag_concepts) - pedwarn (token->location, 0, + pedwarn (token->location, OPT_Wc__20_extensions, "use of % in parameter declaration " "only available with %<-std=c++20%> or %<-fconcepts%>"); else if (cxx_dialect < cxx14) -- cgit v1.1