[PATCH] D89407: [clang-tidy] Add scoped enum constants to identifier naming check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 07:41:25 PDT 2020


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from a minor nit.



================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:410
+  if (const auto *EnumConst = dyn_cast<EnumConstantDecl>(D)) {
+    assert(isa<EnumDecl>(EnumConst->getDeclContext()) &&
+           "DeclContext of EnumConstant should be EnumDecl");
----------------
There's no need for this assertion, the use of `cast<>` below will assert if the type is wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89407



More information about the cfe-commits mailing list