This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16190] make -Wnon-virtual-dtor more sophisticated
- From: "ncm at cantrip dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jun 2004 19:46:07 -0000
- Subject: [Bug c++/16190] make -Wnon-virtual-dtor more sophisticated
- References: <20040625022626.16190.ncm-nospam@cantrip.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ncm at cantrip dot org 2004-06-25 19:46 -------
> Actually, it is necessary and sufficient to generate the warning
> only for delete expressions or pseudo-destructror calls.
Even then it could just as easily be a correct, non-polymorphic
deletion, with no way to "fix" it short of patching the original
header. That's why the warning belongs in -Weffc++: it's where
we dump warnings that are about as likely to be spurious as not.
I.e., even restricting the warnings to deletions would just cause
frustration when the deletion occurs in a standard-library template
instantiation.
bangerth asked, "why -Weffc++ at all?" Because people insist on
putting in warnings that trigger on perfectly good code, for what
appear to be ideological reasons. If we can't keep them out of
the compiler, at least we can stuff them someplace where they only
needle people who like that sort of thing.
I didn't propose moving it to -Weffc++ and back. Moving it back to
-Wall would have to be somebody else's proposal, and would need to be
argued on its own merits. Such a move would encounter strong and
justified resistance. To expect such resistance in the future is
to admit that the warning doesn't belong in -Wall now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16190