Article ID: 150576
Article Last Modified on 10/24/2003
#define WORKAROUND /* Uncomment this line to workaround */
class A
{
virtual void f() { } ;
} ;
class B : public A
{
} ;
void g(const B* pb)
{
#ifndef WORKAROUND
const A* pa = dynamic_cast<const A*>(pb) ;
#else
B* tmpBp = const_cast<B*>(pb) ;
const A* pa = dynamic_cast<const A*>(tmpBp) ;
#endif
}
void main()
{
B bObj ;
const B* pb = &bObj ;
g(pb) ;
}
Additional query words: kbVC400bug
Keywords: kbbug kbfix kbvc500fix kbcompiler KB150576