(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp0x/
extern_template-4.C
// PR c++/85470
// { dg-do compile { target c++11 } }

template <class T>
struct StaticObject
{
    static T& create()
    {
      static T t;
      return t;
    }

    static T & instance;
};

template <class T> T & StaticObject<T>::instance = StaticObject<T>::create();

extern template class StaticObject<int>;

void test()
{
    StaticObject<int>::instance;
}