Skip to content

Commit a1b67a6

Browse files
committed
fix
1 parent 151cdfc commit a1b67a6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/checkother.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4140,7 +4140,8 @@ static const Token *findShadowed(const Scope *scope, const Variable& var, int li
41404140
return v.nameToken();
41414141
}
41424142
auto it = std::find_if(scope->functionList.cbegin(), scope->functionList.cend(), [&](const Function& f) {
4143-
return f.type == FunctionType::eFunction && f.name() == var.name() && precedes(f.tokenDef, var.nameToken());
4143+
return f.type == FunctionType::eFunction && f.name() == var.name()
4144+
&& (scope->isClassOrStructOrUnion() || precedes(f.tokenDef, var.nameToken()));
41444145
});
41454146
if (it != scope->functionList.end())
41464147
return it->tokenDef;

0 commit comments

Comments
 (0)