We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Cloned to rdar://problem/8979966.
Sorry, something went wrong.
Fixed at r125296. Thanks for the report!
Merge pull request llvm#9554 from swiftlang/egorzhdan/20240723-class-…
14e578f
…template-packs 🍒[Clang] Dispatch default overloads of `TemplateArgumentVisitor` to the implementation
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: