aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/eh/unwind1.C
blob: da7aa98fe59362eca7969987e0a37aa0c9882584 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR middle-end/28493

extern "C" void abort ();

struct Command *ptr;

struct Command {
  Command() { ptr = this; }
  virtual ~Command() { if (ptr != this) abort(); }
};

void tryfunc()
{
  Command cmd;
  throw 1;
}

int main()
{
  try
    {
      tryfunc();
    }
  catch (int) { }
}