[Bug c++/88050] New: Add a warning for breaking the "Rule of Three"
martingalvan at sourceware dot org
gcc-bugzilla@gcc.gnu.org
Thu Nov 15 19:22:00 GMT 2018
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.
More information about the Gcc-bugs
mailing list