[PATCH] D137302: [clang-tidy] Add modernize-type-traits check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 10:36:56 PDT 2023


njames93 marked 2 inline comments as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp:170
+
+static constexpr char Bind[] = "";
+
----------------
ccotter wrote:
> NIT: should the bound node have some meaningful non-empty name?
Not strictly required as we only ever bind one node.


================
Comment at: clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp:197
+                                      const llvm::StringSet<> &Set) {
+  return ND->isInStdNamespace() && ND->getDeclName().isIdentifier() &&
+         Set.contains(ND->getName());
----------------
ccotter wrote:
> For a future release, could we add an option to allow replacing "standard type traits" defined in separate namespaces, as the [BSL library](https://github.com/bloomberg/bde/blob/main/groups/bsl/bslmf/bslmf_removereference.h#L137) does? This would be useful in my case at least.
This could definitely be extended in the future to support extended traits.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137302



More information about the cfe-commits mailing list