This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26997] g++ reports misleading error message when the identifier with error occurs earlier on the same line
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Oct 2008 01:42:32 -0000
- Subject: [Bug c++/26997] g++ reports misleading error message when the identifier with error occurs earlier on the same line
- References: <bug-26997-10573@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from manu at gcc dot gnu dot org 2008-10-26 01:42 -------
The culprit is (yet again) parsing tentatively. cp_parser_cast_expression
parses tentatively the whole:
(t *)malloc(sizeof(t) * t->a)
not committing to parse definitively at any moment. Hence, when this fails, the
whole thing is rejected and there is no way to know where the error occurred.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26997