[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 09:45:15 PDT 2020


ymandel added a comment.

Tests show that this breaks the test for the clang tidy `abseil-string-find-str-contains`.  Curious if this is a desirable change in behavior (in which case I'll update your test file) or the wrong behavior:

https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/test/clang-tidy/checkers/abseil-string-find-str-contains.cpp#L246-L252

  void no_macros() {
     std::string s;
  -  COMPARE_MACRO(s.find("a"), std::string::npos);
  -  FIND_MACRO(s, "a") == std::string::npos;
  -  FIND_COMPARE_MACRO(s, "a", std::string::npos);
  +  !absl::StrContains(s, "a");
  +  !absl::StrContains(s, "a");
  +  !absl::StrContains(s, "a");
   }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82126/new/

https://reviews.llvm.org/D82126





More information about the cfe-commits mailing list