[PATCH] D131528: [Clang] Restrict non fixed enum to a value outside the range of the enumeration values warning to context requiring a constant expression

Alexander Yermolovich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 08:01:18 PDT 2022


ayermolo added a comment.

In D131528#3722395 <https://reviews.llvm.org/D131528#3722395>, @shafik wrote:

> In D131528#3719430 <https://reviews.llvm.org/D131528#3719430>, @ayermolo wrote:
>
>> Was this and previous change intended to capture this case?
>>  const enum NumberType neg_one = (enum NumberType) ((enum NumberType) 0 - (enum NumberType) 1);
>
> That was not intended and I plan on fixing that.

Ah I see. Thanks for elaborating. Can you tag me in the fix diff please.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131528



More information about the cfe-commits mailing list