[all-commits] [llvm/llvm-project] 1fdb3e: abseil-string-find-str-contains should not propose...

tdl-g via All-commits all-commits at lists.llvm.org
Tue Aug 10 09:40:02 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fdb3e36ff379e5b3b05a00d49b6081435df727a
      https://github.com/llvm/llvm-project/commit/1fdb3e36ff379e5b3b05a00d49b6081435df727a
  Author: Tom Lokovic <tdl at google.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/abseil-string-find-str-contains.cpp

  Log Message:
  -----------
  abseil-string-find-str-contains should not propose an edit for the three-parameter version of find().

std::string, std::string_view, and absl::string_view all have a three-parameter version of find()
which has a "count" (or "n") paremeter limiting the size of the substring to search.  We don't want
to propose changing to absl::StrContains in those cases.  This change fixes that and adds unit tests
to confirm.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D107837




More information about the All-commits mailing list