Checking dependent_type_p avoids needing to walk the overloads in cases
where it would not be possible to find a dependent using.
PR c++/105006
gcc/cp/ChangeLog:
* name-lookup.cc (lookup_using_decl): Check that scope is
a dependent type before looking for dependent using.
/* If the lookup in the base contains a dependent using, this
using is also dependent. */
- if (!dependent_p && lookup.value)
+ if (!dependent_p && lookup.value && dependent_type_p (scope))
{
tree val = lookup.value;
if (tree fns = maybe_get_fns (val))