[PATCH] D130058: [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 10:14:20 PDT 2022


aaron.ballman added a comment.

In D130058#3687680 <https://reviews.llvm.org/D130058#3687680>, @thakis wrote:

> Hello, this breaks a bunch of existing code over here (and I imagine elsewhere).

Do you have an idea on how much a bunch is and whether the fixes are particularly involved or not? Did it break a system header?

> Can we make this a warning that's mapped to an error by default, so that people can turn it off for a while while they fix their code?

It might be possible to do that, but I'd like to better understand the situation before we make a decision. This was fixing an accepts-invalid bug in Clang and we usually don't turn that into a warning-as-error unless there's a significant amount of code to be fixed in the ecosystem (like implicit int being accepted for a decade+ even when it was "wrong" for compilers to do so). However, Clang is the first compiler to actually get this particular behavior right, so I am sympathetic to turning it into a warning that defaults to an error.


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

https://reviews.llvm.org/D130058



More information about the cfe-commits mailing list