[forwarded from http://bugs.debian.org/212260] This code: #include <stdio.h> struct foo { ~foo() { } virtual void bar() { } }; struct fum: public foo { virtual ~fum() { printf("x\n"); } }; main() { foo *x = new fum; delete x; } generates: blah.cc:2: warning: `struct foo' has virtual functions but non-virtual destructor and "x" is not output. (This is expected.) Comment out the ~foo dtor. The code is still incorrect ("x" is still not output), but no warning is reported. As the default dtor is non-virtual, this warning should also be output if an object has virtual functions but no destructor at all.
Confirmed. A better explation is that there is no warning if there is not a destructor there at all.
This is a dup of bug 11624. *** This bug has been marked as a duplicate of 11624 ***