This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2263. Default argument instantiation for friends

Section: 13.9.2  [temp.inst]     Status: drafting     Submitter: Hubert Tong     Date: 2016-05-04

The instantiation of default arguments for friends defined in a templated entity is not covered by 13.7.1 [temp.decls.general] paragraph 3 or 13.9.2 [temp.inst] paragraph 2. Consider:

  template <typename T>
  struct A {
    friend void foo(A &&, int = T::happy) { }
  };

  int main(void) { foo(A<int>(), 0); }

There is implementation divergence in the treatment of this example.

Notes from the December, 2016 teleconference:

This issue should be resolved by the resolution of issue 2174.