Skip to content
New issue

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

spurious warning on overloaded-virtual #9554

Closed
llvmbot opened this issue Feb 10, 2011 · 2 comments
Closed

spurious warning on overloaded-virtual #9554

llvmbot opened this issue Feb 10, 2011 · 2 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@llvmbot
Copy link
Member

llvmbot commented Feb 10, 2011

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.

@akyrtzi
Copy link
Contributor

akyrtzi commented Feb 10, 2011

Cloned to rdar://problem/8979966.

@akyrtzi
Copy link
Contributor

akyrtzi commented Feb 10, 2011

Fixed at r125296. Thanks for the report!

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue Nov 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…template-packs

🍒[Clang] Dispatch default overloads of `TemplateArgumentVisitor` to the implementation
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

2 participants