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

           Summary: Clang accepts static functions that would override
                    virtual ones
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


class A {
public:
  virtual void foo() {}
};

class B : public A {
public:
  static void foo() {}
};



The standard says ([class.virtual]p2) that any function with the same name,
parameter-type-list, cv- and ref-qualifier as a virtual one in a base class
overrides the base version and is virtual itself. It does not exclude static
members from this, and so B::foo above would end up both static and virtual,
which is not allowed. Both G++ and EDG reject the sample, but Clang accepts it.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to