summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/copy1.C
blob: 978599a80d1b28e549fba72f9b2578184902f66f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// { dg-do run  }
// Bug: expand_vec_init doesn't copy arrays of builtin types.

struct B {
  B() { }
  B(const B&) { }
};

struct A
{
  B b;
  int ar[5];
};

int main()
{
  A a;
  for (int i = 0; i < 5; ++i)
    a.ar[i] = i;

  A a2 = a;

  for (int i = 0; i < 5; ++i)
    if (a2.ar[i] != a.ar[i])
      return 1;
}