-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 9182 |
| Resolution | FIXED |
| Resolved on | Feb 10, 2011 12:14 |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @akyrtzi,@DougGregor |
Extended Description
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.