gcc/testsuite/g++.old-deja/g++.jason/default2.C
raw| 1 | // { dg-do assemble } |
| 2 | // PRMS Id: 5921 |
| 3 | // Bug: default arguments containing constructor calls persist incorrectly. |
| 4 | |
| 5 | class foo |
| 6 | { |
| 7 | public: |
| 8 | foo(); |
| 9 | foo(int x); |
| 10 | public: |
| 11 | int iamamember; |
| 12 | }; |
| 13 | |
| 14 | class bar |
| 15 | { |
| 16 | public: |
| 17 | bar(); |
| 18 | int memberfunction(int i, const char *j, double k, foo foo1 = foo(0)); |
| 19 | }; |
| 20 | |
| 21 | int |
| 22 | pain(bar *bar1) |
| 23 | { |
| 24 | return bar1->memberfunction(1, "x", 0.0); |
| 25 | } |
| 26 | |
| 27 | int |
| 28 | pain2(bar *bar1) |
| 29 | { |
| 30 | return bar1->memberfunction(1, "x", 0.0); |
| 31 | } |