Redundant Expression Checker is updated to target expressions with suspicious operator usage.
The checker finds the following two cases, where operators are suspected to be mistaken for another operator, that is considered to be more effective in that particular expression.
1.) Left shift operator might be confused with right shift operator
The expression always evaluates to zero, because Y is shifted left with more bits that the leftmost effective (1) bit of 0xff.
Y = (Y << 8) & 0xff; // Possible intended expression: Y = (Y >> 8) & 0xff;
2.) Bitwise NOT mistaken for logical NOT
A logical not is applied to a bitwise operator expression with integer constant operands, then assigned to an int.
int K = !(1 | 2 | 4); // Possible intended expression: int K = ~(1 | 2 | 4);
Include <cmath> instead.