From 1db815f4f38be2028ab386b2a5e5e43a88280d21 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 6 Nov 2020 05:57:34 -0800 Subject: [PATCH] c++: Parser tweaks We need to adjust the wording for 'export'. Between c++11 and c++20 it is deprecated. Outside those ranges it is unsupported (at the moment). While here, there's also an unneeded setting of a bool -- it's inside an if block that just checked it was true. gcc/cp/ * parser.c (cp_parser_template_declaration): Adjust 'export' warning. (cp_parser_explicit_specialization): Remove unneeded bool setting. --- gcc/cp/parser.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f030cad18b2..6e7b982f073 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16031,8 +16031,13 @@ cp_parser_template_declaration (cp_parser* parser, bool member_p) { /* Consume the `export' token. */ cp_lexer_consume_token (parser->lexer); - /* Warn that we do not support `export'. */ - warning (0, "keyword % not implemented, and will be ignored"); + /* Warn that this use of export is deprecated. */ + if (cxx_dialect < cxx11) + warning (0, "keyword % not implemented, and will be ignored"); + else if (cxx_dialect < cxx20) + warning (0, "keyword % is deprecated, and is ignored"); + else + warning (0, "keyword % not implemented, and will be ignored"); } cp_parser_template_declaration_after_export (parser, member_p); @@ -17753,7 +17758,6 @@ cp_parser_explicit_specialization (cp_parser* parser) /* Give it C++ linkage to avoid confusing other parts of the front end. */ push_lang_context (lang_name_cplusplus); - need_lang_pop = true; } /* Let the front end know that we are beginning a specialization. */ -- 2.30.2