diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-11-06 05:57:34 -0800 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-11-06 06:00:14 -0800 |
commit | 1db815f4f38be2028ab386b2a5e5e43a88280d21 (patch) | |
tree | fc22bfde2c046d689e58723dc799ef67271fb0d7 /gcc | |
parent | 15bcd01a94c23f312ac03b5faea29f18ef8d2a07 (diff) | |
download | gcc-1db815f4f38be2028ab386b2a5e5e43a88280d21.zip gcc-1db815f4f38be2028ab386b2a5e5e43a88280d21.tar.gz gcc-1db815f4f38be2028ab386b2a5e5e43a88280d21.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/parser.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f030cad..6e7b982 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 %<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. */ |