Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / eh / ehopt1.C
blobb2fb4121d09ed123e7108a2ce0fbfab0a15ce6b7
1 // ehopt was only copying one statement from the cleanup of the B temporary
2 // into the following try block, so we lost its destructor call.
4 // { dg-do run }
6 template <class T, class U>
7 class A;
9 bool b;
10 int count;
12 template <>
13 class A<int, int>
15 public:
16   A(int) { ++count; if (b) throw 1; }
17   A(const A&) { ++count; if (b) throw 1; }
18   ~A() throw(int) { --count; if (b) throw 1; }
21 typedef A<int, int> B;
23 template <>
24 class A<void *, void *>
26 public:
27   A() { if (b) throw 1; }
28   A(const B&) { if (b) throw 1; }
29   ~A() throw(int) { if (b) throw 1; }
32 typedef A<void *, void *> C;
34 void f() { if (b) throw 1; }
36 int
37 main (void)
39   {
40     C a(1);
41     f();
42   }
43   return count;