gcc/testsuite/g++.dg/torture/pr56854.C
raw| 1 | // PR tree-optimization/56854 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | inline void * |
| 5 | operator new (__SIZE_TYPE__, void *p) throw () |
| 6 | { |
| 7 | return p; |
| 8 | } |
| 9 | |
| 10 | struct A |
| 11 | { |
| 12 | int a; |
| 13 | A () : a (0) {} |
| 14 | ~A () {} |
| 15 | A &operator= (const A &v) { this->~A (); new (this) A (v); return *this; } |
| 16 | }; |
| 17 | A b[4], c[4]; |
| 18 | |
| 19 | void |
| 20 | foo () |
| 21 | { |
| 22 | for (int i = 0; i < 4; ++i) |
| 23 | c[i] = b[i]; |
| 24 | } |