[LLVMbugs] [Bug 10234] New: clang should warn if a class and its subclass have a method with the same signature but no "virtual" in base class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 30 16:25:56 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10234

           Summary: clang should warn if a class and its subclass have a
                    method with the same signature but no "virtual" in
                    base class
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Consider

class A {
public:
  void f() {}
};

class B : public A {
public:
  void f() {}
};

It is likely that B::m is supposed to be an override of A::m, but "virtual" is
missing. We should add this warning and check how noisy it is. If it's not
noisy, it should be added to the -Wall group.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list