File tree 3 files changed +8
-1
lines changed 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ void NonZeroEnumToBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
64
64
EnumIgnoreList)))
65
65
.bind (" enum" ))))),
66
66
unless (declRefExpr (to (enumConstantDecl ()))),
67
- unless (ignoringImplicit (ExcludedOperators)))),
67
+ unless (ignoringParenImpCasts (ExcludedOperators)))),
68
68
unless (hasAncestor (staticAssertDecl ())))
69
69
.bind (" cast" ),
70
70
this );
Original file line number Diff line number Diff line change @@ -112,6 +112,11 @@ New check aliases
112
112
Changes in existing checks
113
113
^^^^^^^^^^^^^^^^^^^^^^^^^^
114
114
115
+ - Improved :doc: `bugprone-non-zero-enum-to-bool-conversion
116
+ <clang-tidy/checks/bugprone/non-zero-enum-to-bool-conversion>` check by
117
+ eliminating false positives resulting from direct usage of bitwise operators
118
+ within parentheses.
119
+
115
120
- Improved :doc: `bugprone-suspicious-include
116
121
<clang-tidy/checks/bugprone/suspicious-include>` check by replacing the local
117
122
options `HeaderFileExtensions ` and `ImplementationFileExtensions ` by the
Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ CustomOperatorEnum operator&(CustomOperatorEnum a, CustomOperatorEnum b) { retur
122
122
123
123
void testCustomOperator (CustomOperatorEnum e) {
124
124
if (e & E1 ) {}
125
+ if ((e & E1 )) {}
126
+ if (!(e & E1 )) {}
125
127
}
126
128
127
129
}
You can’t perform that action at this time.
0 commit comments