This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.95.2 does not provide useful error message when dynamic_cast fails
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ 2.95.2 does not provide useful error message when dynamic_cast fails
- From: Steven Grady <grady at digitaldeck dot com>
- Date: Tue, 07 Mar 2000 13:28:55 -0800
According to the code (cp/rtti.c: build_dynamic_cast_1), almost all
errors result in
the same message:
cannot dynamic_cast `%E' (of type `%#T') to type `%#T
This message is not particularly explanatory. In particular, it took me
a couple
of hours to figure out that a dynamic cast was failing because the type
of the
expr being cast did not have a vtbl. (I figured out the problem only by
looking
at the above gcc source code.)
Steven