Date
2022-02-18.07:47:23
Message id
5833

Content

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.