[PATCH] D35187: [libclang] Support for querying whether an enum is scoped

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 03:14:32 PDT 2017


arphaman added a comment.

Thanks for the patch.
I have just one minor comment:



================
Comment at: tools/libclang/CIndex.cpp:7815
+  const Decl *D = cxcursor::getCursorDecl(C);
+  const EnumDecl *Enum = D ? dyn_cast_or_null<EnumDecl>(D) : nullptr;
+  return (Enum && Enum->isScoped()) ? 1 : 0;
----------------
`dyn_cast_or_null` already checks if `D` is null, so the ternary operator is redundant. You can also use `const auto *` once you use just the `dyn_cast_or_null`.


https://reviews.llvm.org/D35187





More information about the cfe-commits mailing list