https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16663

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We no longer print the final "initializer expression list treated as compound
expression" error.

If we make the example a little more realistic so the thing being mispelled is
actually in scope, then GCC does better these days:

struct mispelled { };

void Foo(misspelled a, char b, bool c, float f);

For this we get:


foo.C:2:6: error: variable or field 'Foo' declared void
    2 | void Foo(misspelled a, char b, bool c, float f);
      |      ^~~
foo.C:2:10: error: 'misspelled' was not declared in this scope; did you mean
'mispelled'?
    2 | void Foo(misspelled a, char b, bool c, float f);
      |          ^~~~~~~~~~
      |          mispelled
foo.C:2:24: error: expected primary-expression before 'char'
    2 | void Foo(misspelled a, char b, bool c, float f);
      |                        ^~~~
foo.C:2:32: error: expected primary-expression before 'bool'
    2 | void Foo(misspelled a, char b, bool c, float f);
      |                                ^~~~
foo.C:2:40: error: expected primary-expression before 'float'
    2 | void Foo(misspelled a, char b, bool c, float f);
      |                                        ^~~~~


The subsequent errors are still unhelpful, but the "did you mean" is correct,
and helpful.

Reply via email to