[clang] [Clang] Force expressions with UO_Not to not be non-negative (PR #126846)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 20 13:12:17 PDT 2025


zygoloid wrote:

> But still I feel generate a warning for this case went too far.

Yeah, that's probably right. Maybe for `-` on a signed operand, we should just return the original range with the `NonNegative` flag cleared out, and shouldn't add the extra bit for the `-128 -> 128` edge case. That's not technically correct, but probably is more useful in practice.

https://github.com/llvm/llvm-project/pull/126846


More information about the cfe-commits mailing list