Hi Jakub, all, > On 13 Jan 2018, at 12:32, Jakub Jelinek <ja...@redhat.com> wrote: > >> On Sat, Jan 13, 2018 at 12:12:02PM +0100, Jakub Jelinek wrote: >> Or we could not add those error_mark_nodes and >> gcc_assert (seen_error () || cp_parser_error_occurred (parser)); > > This fixes the testcase: > --- gcc/cp/parser.c.jj 2018-01-11 18:58:48.386391801 +0100 > +++ gcc/cp/parser.c 2018-01-13 12:17:20.545347195 +0100 > @@ -13403,6 +13403,9 @@ cp_parser_decl_specifier_seq (cp_parser* > } > } > > + if (attrs == error_mark_node) > + gcc_assert (seen_error () || cp_parser_error_occurred (parser)); > + else > decl_specs->attributes > = chainon (decl_specs->attributes, > attrs); > but there are 13 chainon calls like this in parser.c. Shouldn't we introduce > a helper function for this, perhaps: > > void > attr_chainon (cp_parser *parser, tree *attrs, tree attr) > { > /* Don't add error_mark_node to the chain, it can't be chained. > Assert this is during error recovery. */ > if (attr == error_mark_node) > gcc_assert (seen_error () || cp_parser_error_occurred (parser)); > else > *attrs = chainon (*attrs, attr); > } > > and change all affected spots, like > > attr_chainon (parser, &decl_specs->attributes, attrs); > > ?
First, thanks for your messages. Personally, at this late time for 8, I vote for something like my most recent grokdeclarator fix and yours above for 83824. Then, for 9, or even 8.2, the more encompassing change for all those chainons. Please both of you let me know how shall we proceed, I could certainly take care of the latter too from now on. Thanks again! Paolo