[Bug c++/26997] g++ reports misleading error message when the identifier with error occurs earlier on the same line

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Oct 26 01:43:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list