2 // RUN: %clang_cc1 -pedantic -fsized-deallocation -std=c++1z -include %s -verify %s
5 // RUN: %clang_cc1 -pedantic -fsized-deallocation -std=c++1z -emit-pch %s -o %t
6 // RUN: %clang_cc1 -pedantic -fsized-deallocation -std=c++1z -include-pch %t -verify %s
8 // RUN: %clang_cc1 -pedantic -fsized-deallocation -std=c++1z -emit-pch -fpch-instantiate-templates %s -o %t
9 // RUN: %clang_cc1 -pedantic -fsized-deallocation -std=c++1z -include-pch %t -verify %s
11 // expected-no-diagnostics
16 using size_t = decltype(sizeof(0));
18 // Call the overaligned form of 'operator new'.
19 struct alignas(256) Q
{ int n
; };
20 void *f() { return new Q
; }
22 // Extract the std::align_val_t type from the implicit declaration of operator delete.
23 template<typename AlignValT
>
24 AlignValT
extract(void (*)(void*, size_t, AlignValT
));
25 using T
= decltype(extract(&operator delete));
29 // ok, calls aligned allocation via placement syntax
30 void *q
= new (T
{16}) Q
;
33 enum class align_val_t
: size_t {};
36 using T
= std::align_val_t
; // ok, same type