[Bug c++/11866] poor diagnostic on undeclared exception
Rob_Davies at NTLworld dot com
gcc-bugzilla@gcc.gnu.org
Mon Aug 11 19:15:00 GMT 2003
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.
More information about the Gcc-bugs
mailing list