[PATCH] D20429: [clang-tidy] Handle using-decls with more than one shadow decl.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 17:07:23 PDT 2016


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

LG with a couple of nits.


================
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:22
@@ +21,3 @@
+// A function that helps to tell whether a TargetDecl will be checked.
+// We only check a TargetDecl if :
+//   * The corresponding UsingDecl is not defined in macros or in class
----------------
`ShouldCheckDecl` might convey the idea better.

================
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:59
@@ -59,1 +58,3 @@
             /*SkipTrailingWhitespaceAndNewLine=*/true));
+    for (const auto It : Using->shadows()) {
+      const auto *TargetDecl = It->getTargetDecl()->getCanonicalDecl();
----------------
It's not iterator, so `It` is a confusing name. Something along the lines of `Shadow` or `UsingShadow` should be better.


http://reviews.llvm.org/D20429





More information about the cfe-commits mailing list