[PATCH] D131307: [Clang] Allow downgrading to a warning the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 11:33:21 PDT 2022


shafik added a comment.

In D131307#3709644 <https://reviews.llvm.org/D131307#3709644>, @erichkeane wrote:

> 



> That IS Undefined Behavior, but I think was unintended by this patch.  The intent of this patch (and its parent) was to diagnose this UB during `constexpr` evaluation.  HOWEVER, this patch seems to have extended it to non-`constexpr` constant evaluation.  So while that _IS_ undefined behavior, I don't think it should be covered by this error (likely a normal 'warning' is fine here, but not this diagnostic).  Hopefully @shafik can correct this when he starts again today.

That was not totally intended. I am working on some changes to narrow down the scope of the diagnostic and hopefully that will reduce the fallout.

Although Erich is correct, that is undefined behavior and should be eventually be fixed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131307



More information about the cfe-commits mailing list