aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/torture/pr56854.C
blob: fc7e30299f686de2f33a7450419c8e02831f8692 (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
// PR tree-optimization/56854
// { dg-do compile }

inline void *
operator new (__SIZE_TYPE__, void *p) throw ()
{
  return p;
}

struct A
{
  int a;
  A () : a (0) {}
  ~A () {}
  A &operator= (const A &v) { this->~A (); new (this) A (v); return *this; }
};
A b[4], c[4];

void
foo ()
{
  for (int i = 0; i < 4; ++i)
    c[i] = b[i];
}