https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84446
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paolo.carlini at oracle dot com --- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> --- Jakub, alternately, the below appears to work, and avoids having to catch the error_mark_node so late: Index: parser.c =================================================================== --- parser.c (revision 257801) +++ parser.c (working copy) @@ -19644,12 +19644,12 @@ cp_parser_init_declarator (cp_parser* parser, member templates. The former involves deferring parsing of the initializer until end of class as with default arguments. So right here we only handle the latter. */ - if (!member_p && processing_template_decl) + if (!member_p && processing_template_decl && decl != error_mark_node) start_lambda_scope (decl); initializer = cp_parser_initializer (parser, &is_direct_init, &is_non_constant_init); - if (!member_p && processing_template_decl) + if (!member_p && processing_template_decl && decl != error_mark_node) finish_lambda_scope (); if (initializer == error_mark_node) cp_parser_skip_to_end_of_statement (parser);