https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101232
Franciszek Witt <franek.witt at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |franek.witt at gmail dot com --- Comment #5 from Franciszek Witt <franek.witt at gmail dot com> --- Hi, I am fwitt from IRC. On https://godbolt.org/z/3PoW93YMs GCC without your patch gives the same misleading error. With your patch, the primary error message is improved, but GCC also generates an additional error message about the missing semicolon. =============================================================== ./bad.cpp: In function ‘void f(int, int)’: ./bad.cpp:8:9: error: expected ‘}’ before ‘j’ 8 | j | ^ ./bad.cpp:6:6: note: to match this ‘{’ 6 | X{ | ^ ./bad.cpp:7:10: error: expected ‘;’ before ‘j’ 7 | i | ^ | ; 8 | j | ~ ./bad.cpp: At global scope: ./bad.cpp:10:1: error: expected declaration before ‘}’ token 10 | } | ^ =============================================================== I would like to fix this. I've just started learning about the compiler internals, so it will probably take some time. I will come back here and ask for help in a few days if I encounter any difficulties. BTW is the "expected declaration" message expected here?