Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.old-deja / g++.eh / cleanup1.C
blob271ecf07873d15917643393e1bee01639857740b
1 // { dg-do run  }
2 // Bug: obj gets destroyed twice because the fixups for the return are
3 // inside its cleanup region.
5 extern "C" int printf (const char *, ...);
7 int d;
9 struct myExc { };
11 struct myExcRaiser {
12   ~myExcRaiser() { throw myExc(); }
15 struct stackObj {
16   ~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); };
19 int test()
21   myExcRaiser rais;
22   stackObj obj;
23   return 0;
26 int main()
28   try {
29     test();
30   }
31   catch (myExc &) {
32     return d != 1;
33   }
34   return 1;