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


2231. Class member access to static data member template

Section: 7.6.1.5  [expr.ref]     Status: NAD     Submitter: Faisal Vali     Date: 2016-02-18

Consider:

  struct A {
    template<class T> static int X;
  };
  template<class T> int A::X = T{};

  A{}.X<int>; // error
  A::X<int>;  // OK

Implementations seem to reject the class member access, despite 7.6.1.5 [expr.ref] bullet 6.1 stating the contrary.

Rationale (November, 2016):

The specification is as intended.