Redundant Expression Checker is updated to find ineffective or redundant bitwise operator expressions.
The checker targets bitwise operator expressions with a symbolic expression and an integer literal as operands, where the expression always evaluates to the same numeric constant or leaves the symbolic expression unaltered.
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;
The checker matches bitwise OR, bitwise AND and their corresponding assignment operators.