aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p783a.C
blob: 1883fc7ded2b0c879abbb6100d0f6766e7d4ff6c (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
// Copying into an object directly is a lose according to tiemann.
// Deleting an object many times is a lose.
// prms-id: 783

extern "C" void printf (char *, ...);
extern "C" void exit (int);

class C {
  int i;
public:
  C() {
    i = 1;
  }
  ~C() {
    if (i != 1) {
      exit(1);
    }
    i = 0;
  }
};

main(int argc, char**argv) {
  C c;
  c = C();
  return 0;
}