------- Comment #15 from ben at decadent dot org dot uk 2007-02-22 01:10 ------- Pawel: Yes, any friend class or function can call a protected or private destructor wrongly. So can members of the class - in fact, even pure virtual members can, since they may still have definitions!
The current implementation warns whenever any function might be able to call a non-virtual destructor in a polymorphic class; this results in many false positives. False warnings result in programmers disabling the warning, or paying less attention to warnings, or (in this case) introducing a virtual destructor for no good reason. That is why I consider the behaviour a bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302