summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
blob: 812b54764e533d263596cea29521e510f1936d24 (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
36
37
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

int i;

struct A
{
  ~A ();
};

A::~A () {
  i = 1;
}

struct B : virtual public A {
};

struct C {
  C ();

  B b;
};

C::C () {
  throw 3;
}

int main () 
{
  try { 
    C c;
  } catch (...) {
  }

  if (i != 1)
    return 1;
}