[Bug c++/16002] [3.4/3.5 regression] Strange error message with new parser

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Wed Jun 16 10:16:00 GMT 2004


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



More information about the Gcc-bugs mailing list