blob: 220372ac1e4ab6434634dbf861d9a85a83cafc6f (
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
|
// { dg-do run }
// GROUPS passed destructors
// dtor file:
// Message-Id: <1992Jun25.181845.18886@leland.Stanford.EDU>
// From: niz@leland.stanford.edu (Jim Nisbet)
// Subject: gcc 2.2.2 -- c++ bug: destructor called twice (example)
// Date: 25 Jun 92 18:18:45 GMT
#include <stdio.h>
int things = 0;
class foo {
public:
foo() { things++; }
foo(const foo&) { things++; }
~foo() { things--; }
int i;
};
void
sub(foo f) {
;
}
int main() {
sub(foo());
if (things == 0)
printf ("PASS\n");
else
{ printf ("FAIL\n"); return 1; }
}
|