-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
[clang] Enable Wenum-constexpr-conversion also in system headers and … #67528
[clang] Enable Wenum-constexpr-conversion also in system headers and … #67528
Conversation
@llvm/pr-subscribers-clang Changes…macros As per review comments on https://reviews.llvm.org/D150226, we should allow for one more release before turning this warning into a hard error, by making it visible in system headers and macros, so that people are aware of it and can work on it. Full diff: https://github.com/llvm/llvm-project/pull/67528.diff 2 Files Affected:
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 477a40630f11097..3b6cfa776c85e46 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -67,6 +67,9 @@ C++ Specific Potentially Breaking Changes
(`#49884 <https://github.com/llvm/llvm-project/issues/49884>`_), and
(`#61273 <https://github.com/llvm/llvm-project/issues/61273>`_)
+- The warning `-Wenum-constexpr-conversion` is now also enabled by default on system headers and
+ macros. It will be turned into a hard (non-downgradable) error in the next Clang release.
+
ABI Changes in This Version
---------------------------
- Following the SystemV ABI for x86-64, ``__int128`` arguments will no longer
diff --git a/clang/include/clang/Basic/DiagnosticASTKinds.td b/clang/include/clang/Basic/DiagnosticASTKinds.td
index d2656310e79c9b8..0019553233fdef6 100644
--- a/clang/include/clang/Basic/DiagnosticASTKinds.td
+++ b/clang/include/clang/Basic/DiagnosticASTKinds.td
@@ -405,7 +405,8 @@ def warn_fixedpoint_constant_overflow : Warning<
InGroup<DiagGroup<"fixed-point-overflow">>;
def warn_constexpr_unscoped_enum_out_of_range : Warning<
"integer value %0 is outside the valid range of values [%1, %2] for the "
- "enumeration type %3">, DefaultError, InGroup<DiagGroup<"enum-constexpr-conversion">>;
+ "enumeration type %3">, DefaultError, ShowInSystemHeader, ShowInSystemMacro,
+ InGroup<DiagGroup<"enum-constexpr-conversion">>;
// This is a temporary diagnostic, and shall be removed once our
// implementation is complete, and like the preceding constexpr notes belongs
|
I would need some help with the failing pre-merge test, I don't really understand why that failure would be related to this patch...
Pinging @gribozavr @ymand @sgatev as Code Owners for the |
43e5902
to
8887959
Compare
It seems checks are broken on trunk, I see commits merged with failing pre-merge tests. They seem to be unrelated to this patch though. Is there anything else you'd like fixed before merging? @dwblaikie @AaronBallman @shafik |
Nothing further from me, at least. But maybe wait for approval from one of the other two. |
Friendly ping @AaronBallman @shafik |
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.
LGTM!
…macros As per review comments on https://reviews.llvm.org/D150226, we should allow for one more release before turning this warning into a hard error, by making it visible in system headers and macros, so that people are aware of it and can work on it.
8887959
to
83d8ad3
Compare
boostorg/mpl#69 is still a problem, unfortunately. |
Thank you for doing this work. |
…macros
As per review comments on https://reviews.llvm.org/D150226, we should allow for one more release before turning this warning into a hard error, by making it visible in system headers and macros, so that people are aware of it and can work on it.