This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52321] poor diagnostic of invalid cast
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Feb 2012 15:30:42 +0000
- Subject: [Bug c++/52321] poor diagnostic of invalid cast
- Auto-submitted: auto-generated
- References: <bug-52321-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52321
--- Comment #2 from Ivan Godard <igodard at pacbell dot net> 2012-02-21 15:30:42 UTC ---
Somewhere there's an attept to coerce a to b that sees the source is a class
and the target is a class and tries to see if the source is derived from
target. That check fails because source is undefined, and the failure
propagates out as other possible casts are tried. If you save the reason for
failure your "can't cast" message can look at the reason. The message could
expand on other possible reasons too.
Just a suggestion - that's how we did it in the Mary compilers, and gave a list
of the plausible reasons for failure.