1- // RUN: %check_clang_tidy %s performance -bool-bitwise-operation %t \
1+ // RUN: %check_clang_tidy %s misc -bool-bitwise-operation %t \
22// RUN: -config="{CheckOptions: { \
3- // RUN: performance -bool-bitwise-operation.StrictMode: false }}"
3+ // RUN: misc -bool-bitwise-operation.StrictMode: false }}"
44
55bool function_with_possible_side_effects ();
66
77void bad_possible_side_effects () {
88 bool a = true , b = false ;
99
1010 a | function_with_possible_side_effects ();
11- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean values instead of bitwise operator '|' [performance -bool-bitwise-operation]
11+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean values instead of bitwise operator '|' [misc -bool-bitwise-operation]
1212 // CHECK-FIXES: a || function_with_possible_side_effects();
1313
1414 a & function_with_possible_side_effects ();
15- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean values instead of bitwise operator '&' [performance -bool-bitwise-operation]
15+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean values instead of bitwise operator '&' [misc -bool-bitwise-operation]
1616 // CHECK-FIXES: a && function_with_possible_side_effects();
1717
1818 a |= function_with_possible_side_effects ();
19- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
19+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
2020 // CHECK-FIXES: a = a || function_with_possible_side_effects();
2121
2222 a &= function_with_possible_side_effects ();
23- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
23+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
2424 // CHECK-FIXES: a = a && function_with_possible_side_effects();
2525
2626 bool c = true ;
2727
2828 a &= function_with_possible_side_effects () && c;
29- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
29+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
3030 // CHECK-FIXES: a = a && function_with_possible_side_effects() && c;
3131
3232 a &= b && function_with_possible_side_effects ();
33- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
33+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
3434 // CHECK-FIXES: a = a && b && function_with_possible_side_effects();
3535
3636 a |= function_with_possible_side_effects () || c;
37- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
37+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
3838 // CHECK-FIXES: a = a || function_with_possible_side_effects() || c;
3939
4040 a |= b || function_with_possible_side_effects ();
41- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
41+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
4242 // CHECK-FIXES: a = a || b || function_with_possible_side_effects();
4343}
4444
@@ -47,37 +47,37 @@ void bad_definitely_side_effects() {
4747 int acc = 0 ;
4848
4949 a | (acc++, b);
50- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean values instead of bitwise operator '|' [performance -bool-bitwise-operation]
50+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean values instead of bitwise operator '|' [misc -bool-bitwise-operation]
5151 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
5252
5353 a & (acc++, b);
54- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean values instead of bitwise operator '&' [performance -bool-bitwise-operation]
54+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean values instead of bitwise operator '&' [misc -bool-bitwise-operation]
5555 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
5656
5757 a |= (acc++, b);
58- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
58+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
5959 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
6060
6161 a &= (acc++, b);
62- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
62+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
6363 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
6464
6565 bool c = true ;
6666
6767 a &= (acc++, b) && c;
68- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
68+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
6969 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
7070
7171 a &= b && (acc++, c);
72- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [performance -bool-bitwise-operation]
72+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '&&' for boolean variable 'a' instead of bitwise operator '&=' [misc -bool-bitwise-operation]
7373 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
7474
7575 a |= (acc++, b) || c;
76- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
76+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
7777 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
7878
7979 a |= b || (acc++, c);
80- // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [performance -bool-bitwise-operation]
80+ // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use logical operator '||' for boolean variable 'a' instead of bitwise operator '|=' [misc -bool-bitwise-operation]
8181 // CHECK-MESSAGES-NOT: :[[@LINE-2]]:{{.*}}: note: FIX-IT applied suggested code changes
8282}
8383
0 commit comments