Skip to content

Commit 39afbaf

Browse files
committed
fix
1 parent 53ff132 commit 39afbaf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "../utils/FixItHintUtils.h"
1111
#include "clang/AST/ASTContext.h"
1212
#include "clang/ASTMatchers/ASTMatchFinder.h"
13+
#include "clang/ASTMatchers/ASTMatchers.h"
1314
#include "clang/Lex/Lexer.h"
1415
#include "clang/Tooling/FixIt.h"
1516
#include <queue>
@@ -301,10 +302,10 @@ void ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
301302
hasCastKind(CK_PointerToBoolean),
302303
hasCastKind(CK_MemberPointerToBoolean)),
303304
// Exclude cases of C23 comparison result.
304-
unless(allOf(
305-
isC23(),
306-
hasSourceExpression(binaryOperator(hasAnyOperatorName(
307-
">", ">=", "==", "!=", "<", "<="))))),
305+
unless(allOf(isC23(),
306+
hasSourceExpression(ignoringParens(
307+
binaryOperator(hasAnyOperatorName(
308+
">", ">=", "==", "!=", "<", "<=")))))),
308309
// Exclude case of using if or while statements with variable
309310
// declaration, e.g.:
310311
// if (int var = functionCall()) {}

0 commit comments

Comments
 (0)