Erik <esigra@xxxxxxxxx> writes: > This will throw std::bad_cast if the bug in question is encountered. Of > course it is not practically possible to add such an assertion to the > beginning of every method, but there should be a compiler flag to enable > this (in debug builds). Is there such a flag? Is there a feature request > for it? There is no such flag or feature request. Moreover, even if there were such a flag, it would not work reliably for your example. If an object has been destroyed, what dynamic_cast will return is essentially random. I would argue against adding such a feature to the compiler. This is an area better addressed by -fmudflap or valgrind. Ian