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

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Tue Jul 27 22:14:00 GMT 2004


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



More information about the Gcc-bugs mailing list