In the program #include <stdio.h> struct Base1 { int x1; }; struct Base2 { int x2; }; struct Derived: public Base1, public Base2 {}; int main() { Derived const * d = new Derived; printf("%p %p %p\n", d, (Base2 *) d, (Base2 const *) d); } the cast "(Base2 *) d" effectively does a const_cast< Base2 * >(reinterpret_cast< Base2 const * >(d)) instead of a const_cast< Base2 * >(static_cast< Base2 const * >(d)) (with the effect that of the three printed pointer values, errouneously the first two are identical instead of the last two). This is in violation of 5.4/5 of the C++ Standard. This happens with both 4.0.0 and 4.0.1, but not with 3.4.3. This error affects the OpenOffice.org code base.
This has already been fixed in 4.0.2. This is a dup of bug 22132. *** This bug has been marked as a duplicate of 22132 ***