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: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Feb 2012 15:58:26 +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
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #5 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-02-22 15:58:26 UTC ---
(In reply to comment #4)
> Define an enum of reasons with "success" first, flop the sense of the test so
> that false means coercion was OK (grep to find all calls and put a "!" in front
> of each), and return the reason enum instead of bool. The code that is
> reason-aware saves the enum and builds a good message; the legacy code that is
> not reason-aware treats the enum as a bool and works as before except for the
> inverted sense of the test. Maybe half an hour of work.
>
> Plausible?
Plausible in theory, sadly unrealistic in practice. But I would like to be
proven wrong, so give it a try.