gcc/testsuite/g++.old-deja/g++.mike/p783a.C
raw| 1 | // { dg-do run } |
| 2 | // Copying into an object directly is a lose according to tiemann. |
| 3 | // Deleting an object many times is a lose. |
| 4 | // prms-id: 783 |
| 5 | |
| 6 | extern "C" int printf (const char *, ...); |
| 7 | extern "C" void exit (int); |
| 8 | |
| 9 | class C { |
| 10 | int i; |
| 11 | public: |
| 12 | C() { |
| 13 | i = 1; |
| 14 | } |
| 15 | ~C() { |
| 16 | if (i != 1) { |
| 17 | exit(1); |
| 18 | } |
| 19 | i = 0; |
| 20 | } |
| 21 | }; |
| 22 | |
| 23 | int main(int argc, char**argv) { |
| 24 | C c; |
| 25 | c = C(); |
| 26 | return 0; |
| 27 | } |