https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95156
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unknown |11.0 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |msebor at gcc dot gnu.org Known to fail| |10.1.0, 11.0, 9.2.0 Keywords| |diagnostic Last reconfirmed| |2020-05-15 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- In C mode the warning function, warn_tautological_bitwise_comparison (const op_location_t &loc, tree_code code, tree lhs, tree rhs), gets a BIT_AND_EXPR while in C++ mode it's passed a NOP_EXPR that casts the result of the same BIT_AND_EXPR as in C to int. The cast seems pointless since the type of the BIT_AND_EXPR already is int. I couldn't find a version where G++ did issue the expected warning so it's not a regression. (As an aside, the volatile qualifier isn't necessary to reproduce the bug.)