diff mbox series

c++: Parser tweaks

Message ID 697cc2cb-b542-4eab-94ff-f419dce0f70e@acm.org
State New
Headers show
Series c++: Parser tweaks | expand

Commit Message

Nathan Sidwell Nov. 6, 2020, 2 p.m. UTC
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.

pushing to trunk
diff mbox series

Patch

diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c
index e7bfbf649a5..c948dc9d050 100644
--- i/gcc/cp/parser.c
+++ w/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 %<export%> not implemented, and will be ignored");
+      /* Warn that this use of export is deprecated.  */
+      if (cxx_dialect < cxx11)
+	warning (0, "keyword %<export%> not implemented, and will be ignored");
+      else if (cxx_dialect < cxx20)
+	warning (0, "keyword %<export%> is deprecated, and is ignored");
+      else
+	warning (0, "keyword %<export%> 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.  */