njames93 added inline comments.
================
Comment at:
clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp:1-2
+//===--- StringFindStrContainsCheck.cc - clang-tidy---------------*- C++
+//-*-===//
+//
----------------
Don't need the C++ specifier in a cpp file.
```
//===--- StringFindStrContainsCheck.cpp - clang-tidy
----------------------===//```
================
Comment at:
clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp:71-72
+ binaryOperator(hasOperatorName("=="),
+ hasEitherOperand(ignoringParenImpCasts(StringNpos)),
+ hasEitherOperand(ignoringParenImpCasts(StringFind))),
+ change(cat("!absl::StrContains(", node("string_being_searched"),
----------------
This is dangerous, it will match on `std::string::npos == std::string::npos`
and (more importantly) `strA.find(...) == strB.find(...)`. See D80054.
================
Comment at:
clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp:78-79
+ binaryOperator(hasOperatorName("!="),
+ hasEitherOperand(ignoringParenImpCasts(StringNpos)),
+ hasEitherOperand(ignoringParenImpCasts(StringFind))),
+ change(cat("absl::StrContains(", node("string_being_searched"), ",
",
----------------
Same as above.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80023/new/
https://reviews.llvm.org/D80023
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits