1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template <class Alloc>
12 // struct allocator_traits
14 // static constexpr pointer allocate(allocator_type& a, size_type n);
22 #include "test_macros.h"
23 #include "incomplete_type_helper.h"
30 TEST_CONSTEXPR_CXX20
A() {}
32 TEST_CONSTEXPR_CXX20 value_type
* allocate(std::size_t n
)
41 TEST_CONSTEXPR_CXX20
bool test()
45 assert(std::allocator_traits
<A
<int> >::allocate(a
, 10) == &a
.storage
);
48 typedef A
<IncompleteHolder
*> Alloc
;
50 assert(std::allocator_traits
<Alloc
>::allocate(a
, 10) == &a
.storage
);
60 static_assert(test());