[Interest] dynamic_cast failing

René J.V. Bertin rjvbertin at gmail.com
Sat Apr 11 18:27:58 CEST 2015


On Saturday April 11 2015 18:31:38 Nikos Chantziaras wrote:

Thanks,

>You might be hitting some undefined behavior. Do your classes have 
>virtual functions? If not, dynamic_cast can fail, as it's only supposed 
>to work with polymorphic classes.

I'll have a look; it's not my own code, I'm just hunting down whatever bug causes this cast to fail (and as a result crash the app because failure isn't handled).

However, your suggestion would cause the dynamic_cast to fail everywhere, not just on OS X, right? It seems a bit far-fetched to disable virtual destructors on OS X ...

R.



More information about the Interest mailing list