Some libstdc++ tests were failing with import std because ADL didn't find
rethrow_exception, even though it's a friend. The problem turned out to be
because it's not in the same namespace, and in C++17 ADL only makes hidden
friends visible. But in C++20 P1787 changed [basic.lookup.argdep]/4.2 to
directly include all friends in the lookup.
Note that my change still excludes class members, even though the standard
doesn't specify that; including implicit object member functions would just
break, and even foreign static/xobj member functions seem like they would be
strange to include.
gcc/cp/ChangeLog:
* name-lookup.cc (name_lookup::adl_class_fns): Include all
namespace-scope friends.