[PATCH] D64151: Enhance abseil-faster-strsplit-delimiter to handle other non-printable characters.
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 3 14:24:08 PDT 2019
lebedev.ri added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp:42-43
+ const ASTContext &Context) {
+ assert(Literal->getLength() == 1);
+ assert(Literal->getCharByteWidth() == 1); // no wide char
+ std::string Result = clang::tooling::fixit::getText(*Literal, Context).str();
----------------
Assertion messages missing
================
Comment at: clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp:55
+
+ absl::StrSplit("ABC", R"(A)");
+ // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
----------------
Is there a negative test, `absl::StrSplit("ABC", R"(AA)");`?
Also what about wide chars? (the second assertion)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64151/new/
https://reviews.llvm.org/D64151
More information about the cfe-commits
mailing list