Skip to content

[CIR] Disable -Woverloaded-virtual when compiling with gcc #1440

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

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

andykaylor
Copy link
Collaborator

GCC, unlike clang, issues a warning when one virtual function is overridden in a derived class but one or more other virtual functions with the same name and different signature from a base class are not overridden. This leads to many warnings in the MLIR and ClangIR code when using the OpenConversionPattern<>::matchAndRewrite() function in the ordinary way. The "hiding" behavior is what we want.

GCC, unlike clang, issues a warning when one virtual function is overridden
in a derived class but one or more other virtual functions with the same
name and different signature from a base class are not overridden. This
leads to many warnings in the MLIR and ClangIR code when using the
OpenConversionPattern<>::matchAndRewrite() function in the ordinary way.
The "hiding" behavior is what we want.
@andykaylor
Copy link
Collaborator Author

This is an alternative to #1439

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

(Not sure if pasting discourse links in comments is a good habit these days, but if so we could add that in a follow up PR).

@bcardosolopes bcardosolopes merged commit 7decd95 into llvm:main Mar 5, 2025
7 checks passed
@keryell
Copy link
Collaborator

keryell commented Mar 7, 2025

Thanks for the warning cleaning which was quite annoying.

@andykaylor
Copy link
Collaborator Author

Thanks for the warning cleaning which was quite annoying.

Yes, quite annoying. I need to do this upstream to. Apart from the good discipline of keeping the builds clean, it's painful scrolling through pages and pages of this same warning to find the actual error when a build fails.

lanza pushed a commit that referenced this pull request Mar 18, 2025
GCC, unlike clang, issues a warning when one virtual function is
overridden in a derived class but one or more other virtual functions
with the same name and different signature from a base class are not
overridden. This leads to many warnings in the MLIR and ClangIR code
when using the OpenConversionPattern<>::matchAndRewrite() function in
the ordinary way. The "hiding" behavior is what we want.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants