gcc/testsuite/g++.old-deja/g++.brendan/copy1.C
raw| 1 | // { dg-do run } |
| 2 | // GROUPS passed copy-ctors |
| 3 | extern "C" int printf (const char *, ...); |
| 4 | int count = 0; |
| 5 | |
| 6 | class C { |
| 7 | public: |
| 8 | C (int) { count++; } |
| 9 | operator int () { return 0; } |
| 10 | }; |
| 11 | |
| 12 | int |
| 13 | main () |
| 14 | { |
| 15 | C c1 (1); |
| 16 | C c2 (c1); |
| 17 | |
| 18 | if (count != 1) |
| 19 | { printf ("FAIL\n"); return 1; } |
| 20 | else |
| 21 | printf ("PASS\n"); |
| 22 | } |