[clang-tools-extra] [clang-tidy] 'modernize-use-starts-ends-with': fixed false positives on `find` and `rfind` (PR #129564)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 5 13:37:34 PST 2025
================
@@ -261,6 +273,9 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
#define STRING s
if (0 == STRING.find("ala")) { /* do something */}
+
+ s.find("aaa", 0, 3) == 0;
+ s.rfind("aaa", std::string::npos, 3) == 0;
----------------
vbvictor wrote:
I added matching of cases where `strlen("aaa") == 3rd_arg`, that now only by design TN are not being matched.
https://github.com/llvm/llvm-project/pull/129564
More information about the cfe-commits
mailing list