This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16189] obfuscated error message for missing semicolon after declaration in C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]