[all-commits] [llvm/llvm-project] c783ca: Revert "Missing tautological compare warnings due ...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Aug 2 06:41:31 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c783ca0de1e1e00f364cf4745b8444a020ddd29b
      https://github.com/llvm/llvm-project/commit/c783ca0de1e1e00f364cf4745b8444a020ddd29b
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Analysis/CFG.cpp
    M clang/test/Sema/warn-bitwise-compare.c
    M clang/test/SemaCXX/warn-unreachable.cpp

  Log Message:
  -----------
  Revert "Missing tautological compare warnings due to unary operators"

This reverts commit 0cc3c184c784d5f0d55de8ad0a9eeee876acd149.

The changes did not account for templated code where one instantiation
may trigger the diagnostic but other instantiations will not, as in:
```
template <int I, class T>
void foo(int x) {
    bool b1 = (x & sizeof(T)) == 8;
    bool b2 = (x & I) == 8;
    bool b3 = (x & 4) == 8;
}

void run(int x) {
    foo<4, int>(8);
}
```




More information about the All-commits mailing list