[PATCH] D150226: [Clang] Remove ability to downgrade warning on the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 25 10:49:42 PDT 2023


dblaikie added a comment.

In D150226#4650244 <https://reviews.llvm.org/D150226#4650244>, @carlosgalvezp wrote:

> @shafik @aaron.ballman @dblaikie
>
> Hello! Just wanted to check if there's any blockers for merging this patch? We are now on Clang 18, i.e. 2 releases after the warning was introduced, so IMO I believe it's a good time to turn it into a hard error and test it in the wild.
>
> I read concerns about breaking code. Technically, UB is only invoked in C++17 and onwards (before, it's only unspecified behavior) - could a solution to mitigate risk/break less code be to only enable this hard error in C++17? This way, only people who use a relatively new C++ Standard and compiler would get the error.
>
> I also wonder what is the way forward with respect to code reviews, since Phabricator is deprecated. @shafik do you intend to continue here, or will you move this into a Github PR?
>
> Happy to help if there's anything I can do! Thanks for the great work :)

I still think even if we can subset this, for whatever we're going to turn into a hard error, it should be a warning-as-error in system headers first for at least a release. (so perhaps the transition should look like: null (no diagnostic) -> warning -> warning-default-to-error -> warning-default-to-error-even-in-system-headers -> hard error)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150226/new/

https://reviews.llvm.org/D150226



More information about the cfe-commits mailing list