If compiled with -Wall, g++-4.0.1 will warn on classes with virtual functions but *no* destructor at all. Note that even though this warning is well justified on classes implementing a destructor - because virtual classes might get deleted thru a base class pointer - this warning is not useful for classes with a trivial (compiler-generated) destructor. Note that g++-3.4 and earler releases of g++ did not warn on this case either. How to reproduce: Enter the following code and save as "destructor.cpp": /*snip*/ class A { int x; public: A(int a) : x(a) { } // virtual int get(void) const { return x; } }; class B : public A { int y; public: B(int a) : A(a), y(a+1) { } // virtual int get(void) const { return y; } }; int main(int argc,char **argv) { return 0; } /*snip*/ Then compile as: $ g++-4.0 -Wall destructor.cpp Compiler output is: destructor.cpp:1: warning: 'class A' has virtual functions but non-virtual destructor destructor.cpp:14: warning: 'class B' has virtual functions but non-virtual destructor Note that this warning is unjustified because deleting a class thru a base class pointer works fine if both derived and base class only provide a trivial (compiler-generated) destructor.
Actually this was a requested thing for 4.0, see PR 11624. *** This bug has been marked as a duplicate of 11624 ***