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]
Other format: [Raw text]

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:

class A
{
  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.

--BDS


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