Skip to content

Commit

Permalink
Use overload decl range instead of iterators
Browse files Browse the repository at this point in the history
No functional change.
  • Loading branch information
bolshakov-a committed Apr 5, 2024
1 parent 91202df commit 7abf0e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions iwyu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2213,18 +2213,15 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
}
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();
Expand Down

0 comments on commit 7abf0e1

Please sign in to comment.