[clang-tidy] Misc redundant expression checker updated for ineffective bitwise operat...
authorGabor Horvath <xazax.hun@gmail.com>
Wed, 20 Dec 2017 12:22:16 +0000 (12:22 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Wed, 20 Dec 2017 12:22:16 +0000 (12:22 +0000)
commit91c6671a71449fbd51a6f6214bca43aa7ce690c5
tree31a7b5170a55ad673e906f2a7b69d2601e541a28
parentbf8519b5c9aa2c381b5f4725c21601a99b1b37c2
[clang-tidy] Misc redundant expression checker updated for ineffective bitwise operator expressions

Examples:
* Always evaluates to 0:

```
  int X;
  if (0 & X) return;
```

* Always evaluates to ~0:

```
  int Y;
  if (Y | ~0) return;
```

* The symbol is unmodified:

```
  int Z;
  Z &= ~0;
```

Patch by: Lilla Barancsuk!

Differential Revision: https://reviews.llvm.org/D39285

llvm-svn: 321168
clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp