This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2026-04-17
(From submission #831.)
Consider:
struct A;
namespace ns { int f(A&&); }
struct A {
friend int ns::f(A&&);
};
int x = f(A{});
P1787R6 changed the treatment of this example; see 6.5.4 [basic.lookup.argdep] bullet 4.2.
Proposed resolution (approved by CWG 2026-04-17):
Change in 6.5.4 [basic.lookup.argdep] bullet 4.2 as follows:
The associated namespaces for a call are the innermost enclosing non-inline namespaces for its associated entities as well as every element of the inline namespace set (9.9.2 [namespace.def]) of those namespaces. Argument-dependent lookup finds all declarations of functions and function templates that
- are found by a search of any associated namespace, or
- are declared as a friend (11.8.4 [class.friend]) of any class
with a reachable definitionin the set of associated entities, where the class has a reachable definition and the friend is declared with an unqualified-id as its declarator-id, or- are exported, are attached to a named module M (10.2 [module.interface]), do not appear in the translation unit containing the point of the lookup, and have the same innermost enclosing non-inline namespace scope as a declaration of an associated entity attached to M (6.7 [basic.link]).