This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16002] [3.4/3.5 regression] Strange error message with new parser
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2004 10:16:22 -0000
- Subject: [Bug c++/16002] [3.4/3.5 regression] Strange error message with new parser
- References: <20040615153113.16002.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-06-16 10:16 -------
Not so easy, though. The parser tries several different constructs that can
happen at statement level (function declaration, variable declaration, etc.).
They are all equally possible, and they all fail at different tokens. So the
error "expected primary expression before XXX", it actually means "starting
from XXX, I could not find a valid primary expression".
In this case, I think we should consider the variable declaration to be OK even
without ';' so that we emit a missing semicolon error, and then skip all the
token till the end of the line.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16002