[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

Tommy Chen via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 4 21:30:45 PDT 2024


================
@@ -51,6 +53,12 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) {
   const auto Literal0 = integerLiteral(equals(0));
   const auto Literal1 = integerLiteral(equals(1));
 
+  const auto StringLikeClass = cxxRecordDecl(
+      hasAnyName("::std::basic_string", "::std::basic_string_view",
+                 "::absl::string_view"));
----------------
dl8sd11 wrote:

Agree!

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


More information about the cfe-commits mailing list