gcc/testsuite/g++.old-deja/g++.jason/opeq3.C
raw| 1 | // { dg-do assemble } |
| 2 | // Bug: g++ generates code for assignment in invalid situations. |
| 3 | |
| 4 | class X { // { dg-error "reference|operator=" } |
| 5 | int& a; |
| 6 | public: |
| 7 | X(int& i): a(i) { } |
| 8 | }; |
| 9 | |
| 10 | void foo () |
| 11 | { |
| 12 | int one=1, two=2; |
| 13 | X a(one), b(two); |
| 14 | a = b; // { dg-message "synthesized|deleted" } |
| 15 | } |