}
};
+ typedef llvm::iterator_range<shadow_iterator> shadow_range;
+
+ shadow_range shadows() const {
+ return shadow_range(shadow_begin(), shadow_end());
+ }
shadow_iterator shadow_begin() const {
return shadow_iterator(FirstUsingShadow.getPointer());
}
bool isFunctionScope = Owner->isFunctionOrMethod();
// Process the shadow decls.
- for (UsingDecl::shadow_iterator I = D->shadow_begin(), E = D->shadow_end();
- I != E; ++I) {
- UsingShadowDecl *Shadow = *I;
+ for (auto *Shadow : D->shadows()) {
NamedDecl *InstTarget =
cast_or_null<NamedDecl>(SemaRef.FindInstantiatedDecl(
Shadow->getLocation(), Shadow->getTargetDecl(), TemplateArgs));
// Expand using declarations.
if (isa<UsingDecl>(InstD)) {
UsingDecl *UD = cast<UsingDecl>(InstD);
- for (UsingDecl::shadow_iterator I = UD->shadow_begin(),
- E = UD->shadow_end(); I != E; ++I)
- R.addDecl(*I);
+ for (auto *I : UD->shadows())
+ R.addDecl(I);
continue;
}
// Expand using declarations.
if (isa<UsingDecl>(InstD)) {
UsingDecl *UD = cast<UsingDecl>(InstD);
- for (UsingDecl::shadow_iterator I = UD->shadow_begin(),
- E = UD->shadow_end(); I != E; ++I)
- R.addDecl(*I);
+ for (auto *I : UD->shadows())
+ R.addDecl(I);
continue;
}
// we should do better.
IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D);
- for (UsingDecl::shadow_iterator
- I = D->shadow_begin(), E = D->shadow_end(); I != E; ++I) {
- IndexCtx.handleReference((*I)->getUnderlyingDecl(), D->getLocation(),
- D, D->getLexicalDeclContext());
- }
+ for (const auto *I : D->shadows())
+ IndexCtx.handleReference(I->getUnderlyingDecl(), D->getLocation(), D,
+ D->getLexicalDeclContext());
return true;
}