Eugene.Zelenko added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.cpp:1 +//===- StrlenStringCStrCheck.cpp - Check for strlen(string::c_str()) calls +//-----===// ---------------- Please make it single string. ================ Comment at: clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.cpp:35 + cxxMethodDecl(MethodNameMatcher, + ofClass(cxxRecordDecl(hasName("::std::basic_string")))))); + const auto StrlenCall = ---------------- What about `std::basic_string_view`? Or any class with `c_str/data/length/size`? ================ Comment at: clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.cpp:66 +} // namespace clang \ No newline at end of file ---------------- Please fix. ================ Comment at: clang-tools-extra/docs/ReleaseNotes.rst:135 + +Warns when the return value of `std::basic_string::c_str` or `std::basic_string::data` +is used as the argument for `strlen`, and suggests a fix. ---------------- Please use double back-ticks for language constructs. ================ Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/strlen-string-cstr.rst:6 + +Finds calls to ``strlen`` and similar functions where the result +of ``std::basic_string::c_str`` or ``std::basic_string::data`` is used ---------------- Please make it same as statement in Release Notes. ================ Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/strlen-string-cstr.rst:30 + ``std::basic_string::data`` is used as an argument for ``strlen``. \ No newline at end of file ---------------- Please fix. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/strlen-string-cstr.cpp:61 +} \ No newline at end of file ---------------- Please fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140968/new/ https://reviews.llvm.org/D140968 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits