Use of bitand on boolean operands #77601
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
enhancement
Improving things as opposed to bug fixing, e.g. new or missing feature
The following code gives a warning as expected:
warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical])
However, this code also gives the same warning:
I believe it would be best not to give the warning in the second case. There is no risk of the second case being accidental typo. It would be a nice way of signaling the bitwise AND is intentional to the compiler, rather than casting one of the bools to an int.
The text was updated successfully, but these errors were encountered: