------- Comment #25 from cesarb at cesarb dot net 2007-08-21 10:54 ------- The testcase seems to be missing one case where it should warn:
class H { protected: ~H(); public: virtual void deleteme() = 0; }; H::~H() { } void H::deleteme() { delete this; } class I : public H { protected: ~I(); public: virtual void deleteme() { H::deleteme(); } void oops(); }; I::~I() { } void I::oops() { deleteme(); } Here, H must have a virtual destructor. The point where it can know it should warn is the "delete this;" line. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302