summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.eh/vbase2.C
blob: eaae9d93ace8ecc11d3b8acb1e6f2a399a081324 (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
26
27
28
29
30
31
32
33
34
35
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

int i;

struct A
{
  A () { i++; }
  ~A () { i--; }
};

struct B : public virtual A
{
  B () { throw 1; }
};

struct D: public B, virtual public A
{
};

void f()
{
  D d;
}

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

  return i;
}