Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.robertl / eh990323-1.C
blob221a6d79c47f13033f7f79da94e01f1f10fb3ea4
1 // { dg-do run  }
2 // check cleanup of template temporaries
3 extern "C" void abort ();
4 extern "C" void exit (int);
6 int ctor = 0;
7 int dtor = 0;
9 template <class T> struct A {
10         A() {ctor++;}
11         A(int) {ctor++;}
12         A(const A&) {ctor++;}
13         ~A() {dtor++;}
14         operator int() {return 0;}
17 template <class T> void ff(T);
19 template <class T> void ff(T)
23 void g(int)
27 void f()
29         int x;
31         A<int> a1;
32         A<double> a2(37);
33         A<long> a3 = A<long>(47);
34         A<short> a4 = 97;
36         g(A<char*>());
38         A<char**>();
40         x ? A<char*>() : A<char*>();
42         x = 47, A<double*>(), A<int>(39), A<void>(23), -17;
44         while (A<short>())
45                 ;
46         for (;A<unsigned>(3);)
47                 ;
48         if (A<A<double> >())
49                 ;
51         ff(A<double>());
53         throw 59;
56 int 
57 main()
59         int flag = 0;
61         try {
62                 A<unsigned long>();
63                 f();
64         }
65         catch (int) {
66                 A<float>(34);
67                 flag = 1;
68         }
70         if (!flag)
71                 abort();
73         if (!ctor || ctor != dtor)
74                 abort();
76         exit(0);