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

Bhuminjay Soni via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 16 03:41:50 PDT 2024


================
@@ -45,8 +45,8 @@ void test(boolean a, boolean b, int *p, volatile int *q, int i) {
   b = bar() & (i > 4);
   b = (i == 7) & foo();
 #ifdef __cplusplus
-  b = foo() bitand bar(); // expected-warning {{use of bitwise '&' with boolean operands}}
-                          // expected-note at -1 {{cast one or both operands to int to silence this warning}}
+  b = foo() bitand bar(); // Ok, no warning expected
+                          
----------------
11happy wrote:

done

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


More information about the cfe-commits mailing list