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++/11866] poor diagnostic on undeclared exception


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11866



------- Additional Comments From Rob_Davies at NTLworld dot com  2003-08-11 19:15 -------
The 3.4 message is an improvement, it is NOT exactly right however.  The 
reference to '...' being last is distracting.  Also catch parameter, and the 
type name stuff is not in the terms, the source developer thinks in. 
 
More to the point would be saying directly, "Undeclared exception  
'std:out_of_range' in catch handler". 
 
Having looked at the grammar in Stroustroup, it must be possible, as the 
try/catch is defined so : 
 
try-block: 
    try compound-statement handler-seq 
 
handler-seq: 
    handler handler-seqopt 
 
handler: 
    catch ( exception-declaration ) compound-statement 
 
 
The point is, the parser knows it's looking for an exception declaration at 
that point, so a really clear error message ought to be feasible. 
 
Clear error messages aid developer's alot, a specific message would have made 
my original problem a no brainer, simply grep to find the include file that 
declared the exception.


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