diff options
Diffstat (limited to 'gcc/cp/parser.c')
| -rw-r--r-- | gcc/cp/parser.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ad4d454..3ed7497 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15583,6 +15583,16 @@ cp_parser_function_definition_from_specifiers_and_declarator cp_parser_skip_to_end_of_block_or_statement (parser); fn = error_mark_node; } + else if (DECL_INITIAL (current_function_decl) != error_mark_node) + { + /* Seen already, skip it. An error message has already been output. */ + cp_parser_skip_to_end_of_block_or_statement (parser); + fn = current_function_decl; + current_function_decl = NULL_TREE; + /* If this is a function from a class, pop the nested class. */ + if (current_class_name) + pop_nested_class (); + } else fn = cp_parser_function_definition_after_declarator (parser, /*inline_p=*/false); |
