2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / dtor2.C
blob9555b3789af71b793ec63437f36dfa9e26c23cf3
1 // PR c++/12751
2 // tree-ssa eh lowering bug ran a destructor twice for one object
3 // { dg-do run }
5 static int check;
7 struct Y {
8   Y();
9   ~Y();
12 void foo() {
13   Y y1;
14   Y y2;
15   switch(0) {
16     case 1: {
17         Y y3;
18         return;
19       }
20   }
23 Y::Y() { ++check; }
24 Y::~Y() { --check; }
26 int main()
28   foo ();
29   return check;