aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d020520..0b7dd3c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9455,7 +9455,13 @@ cp_parser_explicit_specialization (cp_parser* parser)
else
need_lang_pop = false;
/* Let the front end know that we are beginning a specialization. */
- begin_specialization ();
+ if (!begin_specialization ())
+ {
+ end_specialization ();
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ return;
+ }
+
/* If the next keyword is `template', we need to figure out whether
or not we're looking a template-declaration. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE))