@@ -48,23 +48,23 @@ void RedundantBranchConditionCheck::registerMatchers(MatchFinder *Finder) {
48
48
.bind (CondVarStr);
49
49
Finder->addMatcher (
50
50
ifStmt (
51
- hasCondition (ignoringParenImpCasts ( anyOf (
51
+ hasCondition (anyOf (
52
52
declRefExpr (hasDeclaration (ImmutableVar)).bind (OuterIfVar1Str),
53
- binaryOperator (hasOperatorName ( " && " ),
54
- hasEitherOperand ( ignoringParenImpCasts (
55
- declRefExpr (hasDeclaration (ImmutableVar))
56
- .bind (OuterIfVar2Str)) ))))),
53
+ binaryOperator (
54
+ hasOperatorName ( " && " ),
55
+ hasEitherOperand ( declRefExpr (hasDeclaration (ImmutableVar))
56
+ .bind (OuterIfVar2Str))))),
57
57
hasThen (hasDescendant (
58
- ifStmt (hasCondition (ignoringParenImpCasts (
59
- anyOf ( declRefExpr (hasDeclaration ( varDecl (
60
- equalsBoundNode (CondVarStr))))
61
- .bind (InnerIfVar1Str),
62
- binaryOperator (
63
- hasAnyOperatorName (" &&" , " ||" ),
64
- hasEitherOperand ( ignoringParenImpCasts (
65
- declRefExpr (hasDeclaration (varDecl (
58
+ ifStmt (hasCondition (anyOf (
59
+ declRefExpr (hasDeclaration (
60
+ varDecl ( equalsBoundNode (CondVarStr))))
61
+ .bind (InnerIfVar1Str),
62
+ binaryOperator (
63
+ hasAnyOperatorName (" &&" , " ||" ),
64
+ hasEitherOperand (
65
+ declRefExpr (hasDeclaration (varDecl (
66
66
equalsBoundNode (CondVarStr))))
67
- .bind (InnerIfVar2Str))))))))
67
+ .bind (InnerIfVar2Str))))))
68
68
.bind (InnerIfStr))),
69
69
forFunction (functionDecl ().bind (FuncStr)))
70
70
.bind (OuterIfStr),
0 commit comments