This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16189] obfuscated error message for missing semicolon after declaration in C++
- From: "bernie at develer dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jul 2004 01:43:56 -0000
- Subject: [Bug c++/16189] obfuscated error message for missing semicolon after declaration in C++
- References: <20040625022408.16189.bernie@develer.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bernie at develer dot com 2004-07-28 01:43 -------
I don't know much about GCC frontends, but I've seen
cases where such ambiguity was being solved by a
speculative parsing trick.
If a mixed struct-declaration and defition statement
causes a syntax error, the parser could insert a
semicolon after the closing brace and try parsing the
resulting two statements again.
If the result is syntactically correct, the compiler
issues a friendly error pointing to the missing
semicolon after the declaration.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16189