Possible RTTI bug
Martin v. Loewis
martin@mira.isdn.cs.tu-berlin.de
Sun Feb 28 23:30:00 GMT 1999
> Is this a bug ?
Thanks for your bug report. Yes, this is a bug; an internal compiler
error is always a compiler bug.
However, the current development version (egcs-2.93.08) compiles this
program and produces the error
a.cc:6: must #include <typeinfo> before using typeid
After including <typeinfo>, the program is compiled and runs correctly
(on i486-pc-linux-gnu). I'm not sure whether the upcoming 1.1.2 has
the relevant fix.
> And where can I find the information about RTTI in egcs ?
RTTI is not specific to g++, it is defined in the C++ standard. Any
good book on C++ should explain it; the Stroustrup book is especially
recommended.
> And what is about conformance of egcs RTTI mechanisms with C++
> standard(s) ?
In principle, it should be completely conforming. Recently
(i.e. yesterday) somebody discovered problems with dynamic_cast in
some obscure situations (private inheritance), but I'm not aware of
any problems with typeid().
One missing documentation item is the string returned by
typeid().name(). In short, it gives some unique internal
representation of the type name.
Regards,
Martin
More information about the Gcc-bugs
mailing list