[all-commits] [llvm/llvm-project] 773e88: [Clang] Force expressions with UO_Not to not be no...

Yutong Zhu via All-commits all-commits at lists.llvm.org
Mon Mar 10 06:09:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 773e88f9d61399c566fed45bf7858922f09b8063
      https://github.com/llvm/llvm-project/commit/773e88f9d61399c566fed45bf7858922f09b8063
  Author: Yutong Zhu <115899167+YutongZhuu at users.noreply.github.com>
  Date:   2025-03-10 (Mon, 10 Mar 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/compare.c

  Log Message:
  -----------
  [Clang] Force expressions with UO_Not to not be non-negative (#126846)

This PR addresses the bug of not throwing warnings for the following
code:
```c++
int test13(unsigned a, int *b) {
        return a > ~(95 != *b); // expected-warning {{comparison of integers of different signs}}
}
```

However, in the original issue, a comment mentioned that negation,
pre-increment, and pre-decrement operators are also incorrect in this
case.

Fixes #18878



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list