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


2936. Local classes of templated functions should be part of the current instantiation

Section: 13.8.3.2  [temp.dep.type]     Status: tentatively ready     Submitter: Richard Smith     Date: 2024-09-02

Consider:

  template<class T>
  void f()
  {
    struct Y {
      using type = int;
    };
    Y::type y;  // error; missing typename
  }

Since lookup of Y always finds the local class, regardless of T, the requirement to apply typename is too strict.

Proposed resolution (approved by CWG 2024-11-08):

Change in 13.8.3.2 [temp.dep.type] paragraph 1 as follows:

A name or template-id refers to the current instantiation if it is