Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.other/dtor6.C

raw
1 // { dg-do run }
2 // Origin: Mark Mitchell <[email protected]>
3
4 extern "C" void abort ();
5
6 int count;
7
8 struct S
9 {
10 S ();
11 S (const S&);
12 ~S ();
13
14 int i;
15 };
16
17 S::S ()
18 {
19 i = count++;
20 }
21
22 S::S (const S&)
23 {
24 i = count++;
25 }
26
27 S::~S ()
28 {
29 if (--count != i)
30 abort ();
31 }
32
33 void f (S, S)
34 {
35 }
36
37 int main ()
38 {
39 {
40 S s;
41 f (s, s);
42 }
43 return count != 0;
44 }
45