summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh45.C
blob: 5bd4dd476d4aaec7aaa7b92ecedb45c0ac10a920 (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  }
int i;
int fail;

class ca {
public:
  ca() {
    if (++i != 1)
      fail = 1;
  }
  virtual ~ca() {
    if (++i != 4)
      fail = 4;
  }
};

class cb {
public:
  cb(const ca &rca) {
    if (++i != 2)
      fail = 2;
  }
  virtual ~cb() {
    if (++i != 3)
      fail = 3;
  }
};

void foo(const cb &rcb) {
}

int main(int argc, char **argv) {
  foo(cb(ca()));
  return fail;
}