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


2255. Instantiated static data member templates

Section: 13.9  [temp.spec]     Status: CD5     Submitter: Mike Miller     Date: 2016-03-29

[Accepted as a DR at the March, 2018 (Jacksonville) meeting.]

The current wording does not state that a specialization of a static data member template (Clause 13 [temp] paragraph 1) is a static data member, which leaves the status of an example like the following unclear (since 7.6.1.5 [expr.ref] bullet 4.1 is phrased in terms of static data members):

  template <class T> struct A {
    template <class U> static const U x = 1;
    static const int y = 2;
  };

  int main() {
    A<int> a;
    int y = a.y;         // OK
    int x = a.x<int>;    // ???
  }

Proposed resolution (November, 2017)

Change 13.9 [temp.spec] paragraph 2 as follows:

A function instantiated from a function template is called an instantiated function. A class instantiated from a class template is called an instantiated class. A member function, a member class, a member enumeration, or a static data member of a class template instantiated from the member definition of the class template is called, respectively, an instantiated member function, member class, member enumeration, or static data member. A member function instantiated from a member function template is called an instantiated member function. A member class instantiated from a member class template is called an instantiated member class. A variable instantiated from a variable template is called an instantiated variable. A static data member instantiated from a static data member template is called an instantiated static data member.