================
@@ -36,221 +36,224 @@ void test(std::string s, std::string_view sv, sub_string 
ss, sub_sub_string sss,
           string_like sl, string_like_camel slc, prefer_underscore_version puv,
           prefer_underscore_version_flip puvf) {
   s.find("a") == 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead 
of find() == 0
+  // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead 
of find == [modernize-use-starts-ends-with]
----------------
hjanuschka wrote:

ok got you, reverted tests, but to prevent showing:

```
use starts_with instead of substr() == 0
```

a small change is needed.
```
  auto Diag = diag(FindExpr->getExprLoc(), 
    FindFun->getName() == "substr" 
        ? "use %0 instead of %1() %select{==|!=}2"
        : "use %0 instead of %1() %select{==|!=}2 0")
    << ReplacementFunction->getName() << FindFun->getName() << Neg;
```

but this makes sure the old tests are unchanged.


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