Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/eh45.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 int i; | |
3 int fail; | |
4 | |
5 class ca { | |
6 public: | |
7 ca() { | |
8 if (++i != 1) | |
9 fail = 1; | |
10 } | |
11 virtual ~ca() { | |
12 if (++i != 4) | |
13 fail = 4; | |
14 } | |
15 }; | |
16 | |
17 class cb { | |
18 public: | |
19 cb(const ca &rca) { | |
20 if (++i != 2) | |
21 fail = 2; | |
22 } | |
23 virtual ~cb() { | |
24 if (++i != 3) | |
25 fail = 3; | |
26 } | |
27 }; | |
28 | |
29 void foo(const cb &rcb) { | |
30 } | |
31 | |
32 int main(int argc, char **argv) { | |
33 foo(cb(ca())); | |
34 return fail; | |
35 } |