gcc/testsuite/g++.dg/cpp1z/aligned-new8.C
raw| 1 | // PR c++/82760 |
| 2 | // { dg-do run { target c++17 } } |
| 3 | |
| 4 | #include <new> |
| 5 | #include <cstddef> |
| 6 | |
| 7 | struct alignas(2 * alignof (std::max_align_t)) aligned_foo { |
| 8 | char x[2048]; |
| 9 | |
| 10 | ~aligned_foo() { } |
| 11 | aligned_foo() { __builtin_memset(x, 0, sizeof(x)); } |
| 12 | }; |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | aligned_foo * gFoo = new (std::nothrow) aligned_foo[2]; |
| 17 | delete[] gFoo; |
| 18 | } |