This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/88050] New: Add a warning for breaking the "Rule of Three"


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]