summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index ac66a770db2..614bb0cbfc9 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -980,13 +980,11 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) {
// Get all the Decls in the DeclContext, and sort them with the
// additional ones we've collected. Then visit them.
- for (DeclContext::decl_iterator I = D->decls_begin(), E = D->decls_end();
- I!=E; ++I) {
- Decl *subDecl = *I;
- if (!subDecl || subDecl->getLexicalDeclContext() != D ||
- subDecl->getLocStart().isInvalid())
+ for (auto *SubDecl : D->decls()) {
+ if (!SubDecl || SubDecl->getLexicalDeclContext() != D ||
+ SubDecl->getLocStart().isInvalid())
continue;
- DeclsInContainer.push_back(subDecl);
+ DeclsInContainer.push_back(SubDecl);
}
// Now sort the Decls so that they appear in lexical order.
OpenPOWER on IntegriCloud