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

2024-04-18


2245. Point of instantiation of incomplete class template

Section: 13.8.4.1  [temp.point]     Status: drafting     Submitter: Richard Smith     Date: 2016-03-08

Consider:

  template<typename T> struct X;

  extern X<int> *p;
  void *q = +p; // #1, complete type affects semantics via ADL

  template<typename T> struct X {};
  X<int> x; // #2, ill-formed, X<int> is incomplete

According to the wording of issue 212, this program is ill-formed, because the single point of instantiation for X<int> is at #1, thus X<int> is an incomplete type even at #2 after the primary template has been completed.

Notes from the December, 2016 teleconference:

The consensus was that references to specializations before the template definition is seen are not points of instantiation.