[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

Helmut Januschka via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 05:38:02 PST 2024


================
@@ -240,6 +240,9 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) {
                                        ReplacementFunction->getName());
 
   // Replace arguments and everything after the function call.
+  if (FindExpr->getNumArgs() == 0) {
+    return;
+  }
----------------
hjanuschka wrote:

moved it before the warning. or should it go after the warning, but before the first fixit?

https://github.com/llvm/llvm-project/pull/116033


More information about the cfe-commits mailing list