gcc/testsuite/g++.old-deja/g++.jason/rfg17.C
raw| 1 | // { dg-do assemble } |
| 2 | // The default assignment operator for B uses array assignment, so we can't |
| 3 | // just disallow it... |
| 4 | |
| 5 | struct A { A& operator=(const A&); }; |
| 6 | struct B { A f[20]; }; |
| 7 | |
| 8 | int a1[20], a2[20]; |
| 9 | B b1, b2; |
| 10 | |
| 11 | void |
| 12 | test () |
| 13 | { |
| 14 | b1 = b2; /* OK */ |
| 15 | a1 = a2; /* { dg-error "6:invalid array assignment" } array assignment */ |
| 16 | } |