This is the mail archive of the gcc@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]

Re: dynamic_cast and MI


H J Lu <hjl@lucon.org> writes:

> There is a dynamic_cast/MI bug in rtti.c. For code like

> 	S0 *ctxt1 = static_cast<S0*>(ctxt);
> 	S1* ctxt2 = dynamic_cast<S1*>(ctxt1);

This is not a bug.  When ctxt is void*, static_cast will just believe
ctxt points to the beginning of a S0 object, which is not the case in
your example.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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