[PATCH] D22507: Clang-tidy - Enum misuse check

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 13 06:50:39 PST 2016

alexfh added a comment.

LG with one nit. Feel free to ping earlier next time.

Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:170-171
+  if (const auto *EnumExpr = Result.Nodes.getNodeAs<Expr>("enumExpr")) {
+    if (!StrictMode)
+      return;
+    const auto *EnumDec = Result.Nodes.getNodeAs<EnumDecl>("enumDecl");
Looks like this is the same as in case 3 below, so you could just move this check out of the branch and remove the duplication below.


More information about the cfe-commits mailing list