[PATCH] D140968: [clang-tidy] Add check for passing the result of `std::string::c_str` to `strlen`

Alex Coster via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 04:41:49 PST 2023


acoster created this revision.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
acoster requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Suggests replacing the call with `std::string::size`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140968

Files:
  clang-tools-extra/clang-tidy/readability/CMakeLists.txt
  clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
  clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.cpp
  clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/strlen-string-cstr.rst
  clang-tools-extra/test/clang-tidy/checkers/readability/strlen-string-cstr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140968.486237.patch
Type: text/x-patch
Size: 11388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230104/f2462650/attachment-0001.bin>


More information about the cfe-commits mailing list