On Thu, Jan 11, 2018 at 5:11 PM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
> On 11/01/2018 21:33, Jason Merrill wrote:
>> On 01/10/2018 06:50 PM, Paolo Carlini wrote:
>>>
>>> thus the below is a rather "dull" solution at the level of
>>> cplus_decl_attributes itself: cp_check_const_attributes is tweaked to check
>>> for error_mark_node at each outer iteration
>>
>> This shouldn't be necessary; we should have returned error_mark_node for
>> the attribute list rather than append it to something else, in which case
>> the existing check for attributes == error_mark_node would have done the
>> job.
>
> Indeed. That seems the most straightforward way to approach the issue.
> Thanks.
>
> In grokdeclarator we could either explicitly assign error_mark_node to
> *attrlist (instead of chaining) or simply drop the erroneous
> declarator->std_attributes. Both solutions appear to work fine in practice,
> pass testing.

Hmm, I think dropping the attributes is reasonable for grokdeclarator
to do as error-recovery, similarly to how it discards an ill-formed
exception-specification.  But let's assert seen_error() in that case.

Jason

Reply via email to