On 3/15/19 9:28 AM, Paolo Carlini wrote:
Hi,
another - rather long standing - error-recovery regression, where, in
some rather special circumstances, we end up passing the FUNCTION_DECL
representing the operator () of the lambda to maybe_dummy_object and
obviously we almost immediately crash. Not sure how much we want to dig
- but simply checking that context_for_name_lookup is actually returning
a type appears to work fine, the error_mark_node then propagates back to
cp_parser_late_parse_one_default_arg and so on. In the special
circumstances of the testcase, context_for_name_lookup finds
ANON_AGGR_TYPE_P set for the DECL_CONTEXT of 'b' and iterates to its
TYPE_CONTEXT which is the FUNCTION_DECL representing the operator () of
the lambda. This is because we just called check_tag_decl on that
anonymous type as part of calling shadow_tag on the abstract
declaration. Tested x86_64-linux.
OK.
Jason