[clang-tools-extra] [clang-tidy] rewrite matchers in modernize-use-starts-ends-with (PR #112101)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 13 02:07:20 PDT 2024


================
@@ -150,8 +150,8 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
   // CHECK-FIXES: puv.starts_with("a");
 
   puvf.find("a") == 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
-  // CHECK-FIXES: puvf.starts_with("a");
+  // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use startsWith
+  // CHECK-FIXES: puvf.startsWith("a");
----------------
5chmidti wrote:

> I feel like most projects are likely to move towards `starts_with` to match standard if multiple overloads are present, so might as well recommend it with higher priority.

Especially when preparing for future migrations. Done


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


More information about the cfe-commits mailing list