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

Mike Hommey via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 13 23:14:25 PDT 2025


glandium wrote:

This had the side effect of adding implicit-int-conversion warnings on e.g. the following code:
```
unsigned char foo(unsigned char x)
{
    return ~x;
}
```
This seems correct, but this should probably be highlighted in the release notes.

Another example is:
```
unsigned int foo(unsigned char x)
{
    return ~(1<<x);
}
```

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


More information about the cfe-commits mailing list