This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] add -Wdelete-non-virtual-dtor


On 2 June 2011 22:27, Jonathan Wakely wrote:
> -Wnon-virtual-dtor isn't always what you want, defining a polymorphic
> object without a virtual destructor is not necessarily a mistake. You
> may never delete such an object so instead of warning when the class
> is defined it's more useful to warn only when the class is deleted, as
> Clang does with -Wdelete-non-virtual-dtor
>
> This patch implements the same warning for G++.

That patch was the wrong one, with a typo in the new test. The correct
one, as tested, is attached, but only differs in the additional }
character in the testcase.

Attachment: delnonvdtor.2.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]