diff options
author | Nicolas van Kempen <nvankempen@meta.com> | 2023-12-04 14:39:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 15:39:28 +0100 |
commit | bc8cff1d7fb2069aa3f7333e25642f2571049af1 (patch) | |
tree | c63335303250513f9bfa6e47bdfbe9113d0d5141 /clang-tools-extra/test/clang-tidy/checkers/readability | |
parent | 2b7191c8993b5608ddb8b89c049717b497265796 (diff) | |
download | llvm-bc8cff1d7fb2069aa3f7333e25642f2571049af1.zip llvm-bc8cff1d7fb2069aa3f7333e25642f2571049af1.tar.gz llvm-bc8cff1d7fb2069aa3f7333e25642f2571049af1.tar.bz2 |
[clang-tidy] Add new modernize-use-starts-ends-with check (#72385)
Make a modernize version of abseil-string-find-startswith using the
available C++20 `std::string::starts_with` and
`std::string_view::starts_with`. Following up from
https://github.com/llvm/llvm-project/pull/72283.
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/readability')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp index 29ac86c..3b9e060 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp @@ -528,12 +528,12 @@ template <typename T> void f() { if (s.size()) ; // CHECK-MESSAGES: :[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty] - // CHECK-MESSAGES: string:28:8: note: method 'basic_string'::empty() defined here + // CHECK-MESSAGES: string:{{[0-9]+}}:8: note: method 'basic_string'::empty() defined here // CHECK-FIXES: {{^ }}if (!s.empty()){{$}} if (s.length()) ; // CHECK-MESSAGES: :[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'length' [readability-container-size-empty] - // CHECK-MESSAGES: string:28:8: note: method 'basic_string'::empty() defined here + // CHECK-MESSAGES: string:{{[0-9]+}}:8: note: method 'basic_string'::empty() defined here // CHECK-FIXES: {{^ }}if (!s.empty()){{$}} } |