[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 05:05:30 PDT 2024


AaronBallman wrote:

> currently the macro definition for both `&` and `bitand` is not giving any warning however should the `&` one warn? or current working is correct behaviour as expected?

The current behavior is what I'd expect. The idea being: if the user is using `&` directly, it's not clear whether they accidentally meant to use `&&` instead, but if they use something with an identifier (a macro, whether it's named `bitand` or not), then there's very little chance they meant `&&` instead.

https://github.com/llvm/llvm-project/pull/81976


More information about the cfe-commits mailing list