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


3174. Handling of friends in argument-dependent lookup

Section: 6.5.4  [basic.lookup.argdep]     Status: tentatively ready     Submitter: Tim Song     Date: 2025-12-18

(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