This is the mail archive of the
mailing list for the GCC project.
dynamic_cast<void*> broken on GCC trunk
- From: Benjamin Smedberg <benjamin at smedbergs dot us>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 03 Aug 2006 14:02:07 -0400
- Subject: dynamic_cast<void*> broken on GCC trunk
The patch for GCC bug 10891 changed the behavior of dynamic_cast<void*> when
RTTI is disabled. The new behavior is too restrictive for certain types of
dynamic_cast that can be reliably performed without any RTTI information:
If you have a class with virtual functions:
virtual DoSomething() = 0;
Mozilla logging code uses dynamic_cast<void*>(someAPtr) to obtain the
most-derived type pointer. This can be obtained from the vtable without any
RTTI information. This construct now gives a compile-time error.
Please consider reverting bug 10891 or be more permissive about dynamic
casts that can work without RTTI.