This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16189] obfuscated error message for missing semicolon after declaration in C++
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2004 22:14:09 -0000
- Subject: [Bug c++/16189] obfuscated error message for missing semicolon after declaration in C++
- References: <20040625022408.16189.bernie@develer.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-07-27 22:14 -------
The reason why this is so hard to get right is that the compiler can't
know what comes after the closing brace of the structure declaration.
It can't assume that you just forgot a semicolon, since all the
following lines are valid (including the last one, which is really ugly):
--------------
struct S1 {} s1;
struct S2 {} s2a, &s2b=s2a;
struct S3 {} ***s3;
struct S4 {} typedef s4;
--------------
I guess you get the message what makes compiler writer's life hard. gcc's
present message is actually not so far away from what one can really
do in this case.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16189