This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11866] poor diagnostic on undeclared exception
- From: "Rob_Davies at NTLworld dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Aug 2003 19:15:10 -0000
- Subject: [Bug c++/11866] poor diagnostic on undeclared exception
- References: <20030809121136.11866.Rob_Davies@NTLworld.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.