@@ -11,9 +11,8 @@ void general(unsigned flags, bool value) {
1111
1212void take (bool value) {}
1313
14- template <bool bb = true | 1 >
15- // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
16- // CHECK-FIXES: template<bool bb = true || 1>
14+ // FIXME: implement `template<bool bb=true|1>` cases
15+
1716void assign_to_boolean (unsigned flags, bool value) {
1817 struct A { bool a = true | 1 ; };
1918 // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
@@ -50,9 +49,6 @@ void assign_to_boolean(unsigned flags, bool value) {
5049 // CHECK-FIXES: result = (flags << 1) || (flags << 2) || (flags << 4) || value;
5150}
5251
53- template <bool bb = (true | 1 )>
54- // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
55- // CHECK-FIXES: template<bool bb = (true || 1)>
5652void assign_to_boolean_parens (unsigned flags, bool value) {
5753 struct A { bool a = (true | 1 ); };
5854 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
@@ -89,9 +85,6 @@ void assign_to_boolean_parens(unsigned flags, bool value) {
8985 // CHECK-FIXES: result = ((flags << 1) || (flags << 2) || (flags << 4) || value);
9086}
9187
92- template <bool bb = ((true | 1 ))>
93- // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
94- // CHECK-FIXES: template<bool bb = ((true || 1))>
9588void assign_to_boolean_parens2 (unsigned flags, bool value) {
9689 struct A { bool a = ((true | 1 )); };
9790 // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
@@ -129,9 +122,6 @@ void assign_to_boolean_parens2(unsigned flags, bool value) {
129122}
130123
131124// functional cast
132- template <bool bb = bool (true | 1 )>
133- // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
134- // CHECK-FIXES: template<bool bb = bool(true || 1)>
135125void assign_to_boolean_fcast (unsigned flags, bool value) {
136126 struct A { bool a = bool (true | 1 ); };
137127 // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
@@ -169,9 +159,6 @@ void assign_to_boolean_fcast(unsigned flags, bool value) {
169159}
170160
171161// C-style cast
172- template <bool bb = (bool )(true | 1 )>
173- // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
174- // CHECK-FIXES: template<bool bb = (bool)(true || 1)>
175162void assign_to_boolean_ccast (unsigned flags, bool value) {
176163 struct A { bool a = (bool )(true | 1 ); };
177164 // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
@@ -209,9 +196,6 @@ void assign_to_boolean_ccast(unsigned flags, bool value) {
209196}
210197
211198// static_cast
212- template <bool bb = static_cast <bool >(true | 1 )>
213- // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
214- // CHECK-FIXES: template<bool bb = static_cast<bool>(true || 1)>
215199void assign_to_boolean_scast (unsigned flags, bool value) {
216200 struct A { bool a = static_cast <bool >(true | 1 ); };
217201 // CHECK-MESSAGES: :[[@LINE-1]]:48: warning: use logical operator '||' for boolean semantics instead of bitwise operator '|' [misc-bool-bitwise-operation]
0 commit comments