-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Reland "Add macro to suppress -Wunnecessary-virtual-specifier" #141091
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
Conversation
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-backend-hexagon Author: Devon Loehr (DKLoehr) ChangesThis fixes #139614 on non-clang compilers by moving Original description: This adds the requested macro to silence It also cleans up any remaining instances of the warning, allowing us to stop disabling it when we build LLVM. Full diff: https://github.com/llvm/llvm-project/pull/141091.diff 19 Files Affected:
|
@cor3ntin can we merge it? building clang with ToT clang results in a lot of warnings now. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/4070 Here is the relevant piece of the build log for the reference
|
// clang-format off | ||
// Autoformatting makes this look awful. | ||
#if defined(__clang__) | ||
// Make sure this is only parsed if __clang__ is defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I think some clangs on some bots don't have __has_warning
; I ran into that recently too: c2a62af I'll push a similar commit for this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, actually I wonder if we should add __has_warning
to the defines further up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went with that in 4a44e00. With that, it's probably safe to put defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
on one line again.
…141091) This fixes llvm#139614 on non-clang compilers by moving `__has_warning` completely inside the `#if defined(__clang__)` block. This prevents a parse failure from compilers which don't recognize `__has_warning`. Original description: Followup to llvm#138741. This adds the requested macro to silence `-Wunnecessary-virtual-specifier` when declaring virtual anchor functions in `final` classes, per [LLVM policy](https://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers). It also cleans up any remaining instances of the warning, allowing us to stop disabling it when we build LLVM.
This fixes #139614 on non-clang compilers by moving
__has_warning
completely inside the#if defined(__clang__)
block. This prevents a parse failure from compilers which don't recognize__has_warning
.Original description:
Followup to #138741.
This adds the requested macro to silence
-Wunnecessary-virtual-specifier
when declaring virtual anchor functions infinal
classes, per LLVM policy.It also cleans up any remaining instances of the warning, allowing us to stop disabling it when we build LLVM.