[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 6 13:31:07 PDT 2023


ccotter added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp:67
+  diag(EnableIf->getBeginLoc(), "incorrect std::enable_if usage detected; use "
+                                "'typename std::enable_if<...>::type'")
+      << TypenameHint << TypeHint;
----------------
PiotrZSL wrote:
> since C++14 we should recommend using enable_if_t
I didn't add replacement logic for C++14 or C++20 since there are separate tools for those, and though it'd be cleaner to have independent set of tools (e.g., first run bugprone-incorrect-enable-if, then run modernize-type-traits).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157239



More information about the cfe-commits mailing list