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


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