public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56879] New: -Weffc++ warns about non-virtual base class destructor even if it is protected
@ 2013-04-08 16:26 ayurchen at gmail dot com
2013-04-08 17:16 ` [Bug c++/56879] " redi at gcc dot gnu.org
2013-04-08 19:06 ` ayurchen at gmail dot com
0 siblings, 2 replies; 3+ messages in thread
From: ayurchen at gmail dot com @ 2013-04-08 16:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56879
Bug #: 56879
Summary: -Weffc++ warns about non-virtual base class destructor
even if it is protected
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ayurchen@gmail.com
Created attachment 29827
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29827
test source code and compiler output
Protected destructor means that the class can't be deleted polymorphically, so
this warning is unnecessary. Together with -Werror it becomes a pain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/56879] -Weffc++ warns about non-virtual base class destructor even if it is protected
2013-04-08 16:26 [Bug c++/56879] New: -Weffc++ warns about non-virtual base class destructor even if it is protected ayurchen at gmail dot com
@ 2013-04-08 17:16 ` redi at gcc dot gnu.org
2013-04-08 19:06 ` ayurchen at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-08 17:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56879
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #29827|application/octet-stream |text/plain
mime type| |
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-08 17:15:59 UTC ---
Comment on attachment 29827
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29827
test source code and compiler output
The solution is simple: don't use -Weffc++, it's deeply flawed. Using it with
-Werror is just ridiculous. It's much better to use -Wdelete-non-virtual-dtor
than -Weffc++
There are lots of known issues with -Weffc++ and noone has been motivated to
fix them, see e.g. PR 22395 comment 5 and PR 16166 comment 3 for some
discussion related to this warning.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/56879] -Weffc++ warns about non-virtual base class destructor even if it is protected
2013-04-08 16:26 [Bug c++/56879] New: -Weffc++ warns about non-virtual base class destructor even if it is protected ayurchen at gmail dot com
2013-04-08 17:16 ` [Bug c++/56879] " redi at gcc dot gnu.org
@ 2013-04-08 19:06 ` ayurchen at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: ayurchen at gmail dot com @ 2013-04-08 19:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56879
--- Comment #2 from alex <ayurchen at gmail dot com> 2013-04-08 19:06:47 UTC ---
(In reply to comment #1)
> Comment on attachment 29827 [details]
> test source code and compiler output
>
> The solution is simple: don't use -Weffc++, it's deeply flawed. Using it with
> -Werror is just ridiculous. It's much better to use -Wdelete-non-virtual-dtor
> than -Weffc++
It is not what we've been using it for (-Wdelete-non-virtual-dtor seems to be
enabled by -Wall already). We'd like to keep other warnings that -Weffc++
generates: it worked nicely for us until this point.
> There are lots of known issues with -Weffc++ and noone has been motivated to
> fix them, see e.g. PR 22395 comment 5 and PR 16166 comment 3 for some
> discussion related to this warning.
Too bad. This one could probably be a one-liner to just disable this warning
since -Wnon-virtual-dtor is already enabled with -Weffc++ (and it does a better
job). But "noone has been motivated" says it all. Anyway, thanks for the
pointers.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-08 19:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-08 16:26 [Bug c++/56879] New: -Weffc++ warns about non-virtual base class destructor even if it is protected ayurchen at gmail dot com
2013-04-08 17:16 ` [Bug c++/56879] " redi at gcc dot gnu.org
2013-04-08 19:06 ` ayurchen at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).