During import of a global variable with external visibility the lookup
will find variables (with the same name) but with static visibility.
Clearly, we cannot put them into the same redecl chain. The same is
true in case of functions. In this fix we filter the lookup results and
consider only those which have the same visibility as the decl we
currently import.
We consider two decls in two anonymous namsepaces to have the same
visibility only if they are imported from the very same translation
unit.
We don't really need an else here and it would be more like an early exit which is what llvm style guide suggests.
In the same vein I would do:
so a second early exit and remove a level of nesting at the same time.