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++/52321] poor diagnostic of invalid cast


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.


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