https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96445

--- Comment #2 from tyu at eridex dot org ---
The extern template and constant are what would appear in the header file for
class C. The explicit instantiation would appear in the source file:

// -- C.h ------------
template <typename T>
class C {
  private:
    constexpr C(T){};
  public:
    constexpr static C<T> make(T t) { return C<T>(t); }
};
extern template class C<int>;
inline constexpr C<int> constant = C<int>::make(0);

// -- C.cpp ----------
template class C<int>;

// -- main.cpp -------
int main() { return 0; }
// -------------------

Reply via email to