http://llvm.org/bugs/show_bug.cgi?id=9182
Summary: spurious warning on overloaded-virtual
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected]
This code warns that the derived class hides a virtual function -- except that
it doesn't:
struct Base {
virtual void foo(int);
};
void Base::foo(int) { }
struct Derived : public Base {
virtual void foo(int);
void foo(int, int);
};
note that if you move the out-of-line Base::foo def'n after struct Derived,
then it doesn't warn any more. Here's the clang output:
$ clang++ -c x.cc -Woverloaded-virtual
x.cc:9:8: warning: 'Derived::foo' hides overloaded virtual function
[-Woverloaded-virtual]
void foo(int, int);
^
x.cc:5:12: note: hidden overloaded virtual function 'Base::foo' declared here
void Base::foo(int) { }
^
1 warning generated.
--
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