OK.

On Mon, May 21, 2018 at 8:41 AM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
> Hi again,
>
> On 19/05/2018 15:30, Jason Merrill wrote:
>>
>> How about doing cp_parser_commit_to_tentative_parse if we see
>> something that must be a declaration?  cp_parser_simple_declaration
>> has
>>
>>    /* If we have seen at least one decl-specifier, and the next token
>>       is not a parenthesis, then we must be looking at a declaration.
>>       (After "int (" we might be looking at a functional cast.)  */
>>    if (decl_specifiers.any_specifiers_p
>>        && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN)
>>        && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)
>>        && !cp_parser_error_occurred (parser))
>>      cp_parser_commit_to_tentative_parse (parser);
>>
>> That seems useful here, as well.  Maybe factored into a separate function.
>
> The below implements this new idea, which indeed appears to work well: I
> tested it and testsuite-wise seems essentially equivalent to what I posted
> yesterday, besides a slightly worse error-recovery for the first issue in
> cpp1z/decomp16.C: an additional 'no match for ‘operator=’' error.
>
> Thanks!
> Paolo.
>
> //////////////////
>

Reply via email to