1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// { dg-do link } // { dg-options "-fno-implicit-templates" } template <class T> struct C { ~C(); }; template <class T> C<T>::~C() {} struct X { C<X> *p; ~X() { delete p; } }; template class C<X>; C<X> x; int main () {}