comparison gcc/testsuite/g++.dg/cpp1z/aligned-new8.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
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 }