gcc/testsuite/g++.old-deja/g++.other/copy1.C
raw| 1 | // { dg-do run } |
| 2 | // Bug: expand_vec_init doesn't copy arrays of builtin types. |
| 3 | |
| 4 | struct B { |
| 5 | B() { } |
| 6 | B(const B&) { } |
| 7 | }; |
| 8 | |
| 9 | struct A |
| 10 | { |
| 11 | B b; |
| 12 | int ar[5]; |
| 13 | }; |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | A a; |
| 18 | for (int i = 0; i < 5; ++i) |
| 19 | a.ar[i] = i; |
| 20 | |
| 21 | A a2 = a; |
| 22 | |
| 23 | for (int i = 0; i < 5; ++i) |
| 24 | if (a2.ar[i] != a.ar[i]) |
| 25 | return 1; |
| 26 | } |