From 7abf0e1b0ead673734c5998b8a80e45b0be0449b Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Fri, 5 Apr 2024 18:31:19 +0300 Subject: [PATCH] Use overload decl range instead of iterators No functional change. --- iwyu.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iwyu.cc b/iwyu.cc index e56cf2aa4..e45cf549d 100644 --- a/iwyu.cc +++ b/iwyu.cc @@ -2213,18 +2213,15 @@ class IwyuBaseAstVisitor : public BaseAstVisitor { } const NamedDecl* first_decl = *expr->decls_begin(); OptionalFileEntryRef first_decl_file_entry = GetFileEntry(first_decl); - for (OverloadExpr::decls_iterator it = expr->decls_begin(); - it != expr->decls_end(); ++it) { - if (GetFileEntry(*it) != first_decl_file_entry) + for (const NamedDecl* decl : expr->decls()) { + if (GetFileEntry(decl) != first_decl_file_entry) return true; } // For now, we're only worried about function calls. // TODO(csilvers): are there other kinds of overloads we need to check? const FunctionDecl* arbitrary_fn_decl = nullptr; - for (OverloadExpr::decls_iterator it = expr->decls_begin(); - it != expr->decls_end(); ++it) { - const NamedDecl* decl = *it; + for (const NamedDecl* decl : expr->decls()) { // Sometimes a UsingShadowDecl comes between us and the 'real' decl. if (const UsingShadowDecl* using_shadow_decl = DynCastFrom(decl)) decl = using_shadow_decl->getTargetDecl();