================
@@ -173,7 +222,80 @@ void UseStartsEndsWithCheck::registerMatchers(MatchFinder 
*Finder) {
       this);
 }
 
+void UseStartsEndsWithCheck::handleSubstrMatch(const MatchFinder::MatchResult 
&Result) {
+  const auto *SubstrCall = 
Result.Nodes.getNodeAs<CXXMemberCallExpr>("substr_fun");
+  const auto *PositiveComparison = 
Result.Nodes.getNodeAs<Expr>("positiveComparison");
+  const auto *NegativeComparison = 
Result.Nodes.getNodeAs<Expr>("negativeComparison");
+  
+  if (!SubstrCall || (!PositiveComparison && !NegativeComparison))
+    return;
+
+  bool Negated = NegativeComparison != nullptr;
----------------
EugeneZelenko wrote:

```suggestion
  const bool Negated = NegativeComparison != nullptr;
```

https://github.com/llvm/llvm-project/pull/116033
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to