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

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 15:49:43 PDT 2022


smeenai added a comment.

In D131528#3723231 <https://reviews.llvm.org/D131528#3723231>, @ayermolo wrote:

> 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.

D131874 <https://reviews.llvm.org/D131874> seems like the fix for that.


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