On Tue, 11 Nov 2025, Alejandro Colomar wrote:

> I've significantly simplified this.  However, the diagnostics are a bit
> worse.  For example:
> 
>       c.c:9:16: error: invalid application of ‘_Maxof’ to something not a type
>           9 |         _Maxof(static int);
>             |                ^~~~~~
>       c.c:9:16: error: expected ‘;’ before ‘static’
>           9 |         _Maxof(static int);
>             |                ^~~~~~
>             |                ;
>       c.c:9:26: error: expected statement before ‘)’ token
>           9 |         _Maxof(static int);
>             |                          ^
> 
> Is this acceptable?  The first diagnostic is correct, but the others are
> consequences of failing too early in the parsing.

I think it's reasonable, but you may be able to reduce the number of 
diagnostics, by using the matching_parens machinery (with 
skip_until_found_close) to go to the closing ')' after parsing the type 
name (successfully or unsuccessfully).

-- 
Joseph S. Myers
[email protected]

Reply via email to