name_lookup lookup (name, want);
if (qualified_namespace_lookup (scope, &lookup))
- t = lookup.value;
+ {
+ t = lookup.value;
+
+ /* If we have a known type overload, pull it out. This can happen
+ for using decls. */
+ if (TREE_CODE (t) == OVERLOAD && TREE_TYPE (t) != unknown_type_node)
+ t = OVL_FUNCTION (t);
+ }
}
else if (cxx_dialect != cxx98 && TREE_CODE (scope) == ENUMERAL_TYPE)
t = lookup_enumerator (scope, name);
found:;
- /* If we have a single function from a using decl, pull it out. */
- if (val && TREE_CODE (val) == OVERLOAD && !really_overloaded_fn (val))
+ /* If we have a known type overload, pull it out. This can happen
+ for both using decls and unhidden functions. */
+ if (val && TREE_CODE (val) == OVERLOAD && TREE_TYPE (val) != unknown_type_node)
val = OVL_FUNCTION (val);
return val;
prefer_type_arg (tag_type),
/*complain=*/true);
- /* If we have a single function from a using decl, pull it out. */
- if (TREE_CODE (decl) == OVERLOAD
- && !really_overloaded_fn (decl))
- decl = OVL_FUNCTION (decl);
-
if (pushed_scope)
pop_scope (pushed_scope);
}