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

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 01:56:06 PDT 2016

alexfh added inline comments.

Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:59
@@ -59,1 +58,3 @@
+    for (const auto It : Using->shadows()) {
+      const auto *TargetDecl = It->getTargetDecl()->getCanonicalDecl();
hokein wrote:
> alexfh wrote:
> > It's not iterator, so `It` is a confusing name. Something along the lines of `Shadow` or `UsingShadow` should be better.
> Actually, the `Using->shadows()` returns an iterator range, but I'm fine renaming it here.
Sure, it returns a `llvm::iterator_range<shadow_iterator>`, which is just a range adaptor for a pair of iterators. It's not a "collection of iterators", it's a "collection, defined by a pair of iterators". If you iterate over it using a range-based for loop, you get whatever is pointed by the iterators, not iterators.



More information about the cfe-commits mailing list