This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/88050] New: Add a warning for breaking the "Rule of Three"
- From: "martingalvan at sourceware dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Nov 2018 19:21:59 +0000
- Subject: [Bug c++/88050] New: Add a warning for breaking the "Rule of Three"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88050
Bug ID: 88050
Summary: Add a warning for breaking the "Rule of Three"
Product: gcc
Version: 8.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: martingalvan at sourceware dot org
Target Milestone: ---
Hi all,
I noticed that gcc doesn't have an option to warn the user when they're
breaking C++'s "Rule of Three" (or Five (or Zero)). For example, this code
doesn't trigger anything when built with e.g. -Wall -Wextra -Wpedantic
-Weffc++:
class Type
{
~Type()
{}
};
int main()
{
Type t;
return 0;
}
It would be useful to have a way catch these at compile time.