[PATCH] D99543: [clang-tidy] Allow opt-in or out of some commonly occuring patterns in NarrowingConversionsCheck.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 13 12:57:31 PDT 2021


aaron.ballman added a comment.

Thanks! I think the changes generally LG, but I did have a question that might generate a small change.



================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:82
+  const auto IsSizeTypeOrDifferenceType = hasType(
+      namedDecl(anyOf(hasName("size_type"), hasName("difference_type"))));
+
----------------
Should this also support `size_t` and `ptrdiff_t` given that those are usually the same as `size_type` and `difference_type`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99543



More information about the cfe-commits mailing list