1 // This is a copy of g++.old-deja/g++.pt/static11.C which at one 2 // time got a SEGV for mmix-knuth-mmixware when compiled with 3 // -da (or either -dj or -df). 4 // { dg-do compile } 5 // { dg-options "-da" } 6 7 extern "C" void _exit (int); 8 9 int r = 1; 10 11 struct A 12 { fA13 void f(){}; AA14 A(){ ++r; } ~AA15 ~A(){ r -= 2; _exit (r); } 16 }; 17 18 template<class T> 19 struct C 20 { CC21 C(){ a.f(); } 22 static A a; 23 }; 24 25 template <class T> A C<T>::a; 26 typedef C<int> B; 27 main()28int main() 29 { 30 C<int> c; 31 return r; 32 } 33 34