This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16166] -Weffc++ finer granularity
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 May 2012 08:34:32 +0000
- Subject: [Bug c++/16166] -Weffc++ finer granularity
- Auto-submitted: auto-generated
- References: <bug-16166-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16166
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-29 08:34:32 UTC ---
(In reply to comment #4)
> * Item 11: Define a copy constructor and an assignment operator for classes
> with dynamically allocated memory.
>
> -Wcopy-resource-class
IMHO this warning should just go. With deleted copy ctor/assign and move
ctor/assign there are even more places where a hard and fast rule isn't useful.
> * Item 12: Prefer initialization to assignment in constructors.
>
> -Wassignment-in-constructor
If I ever get my -Wmeminit patch working properly it would provide this.
> * Item 14: Make destructors virtual in base classes.
>
> Already covered by -Wnon-virtual-dtor
And the more useful -Wdelete-non-virtual-dtor
> In summary, you could simulate exactly the behavior of -Weffc++ by turning on
> each of these warnings individually, or you could turn on -Weffc++ and
> selectively turn off a few warnings that you don't want.
Yep, that would be much better