summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p783a.C
blob: 17609d58314dd8ec077be7664b60c5d99d427711 (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
// { dg-do run  }
// Copying into an object directly is a lose according to tiemann.
// Deleting an object many times is a lose.
// prms-id: 783

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

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

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