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 void deallocate(allocator_type& a, pointer p, size_type n);
22 #include "test_macros.h"
23 #include "incomplete_type_helper.h"
30 TEST_CONSTEXPR_CXX20
A(int& called
) : called_(called
) {}
32 TEST_CONSTEXPR_CXX20
void deallocate(value_type
* p
, std::size_t n
)
34 assert(p
== &storage
);
44 TEST_CONSTEXPR_CXX20
bool test()
49 std::allocator_traits
<A
<int> >::deallocate(a
, &a
.storage
, 10);
54 typedef A
<IncompleteHolder
*> Alloc
;
56 std::allocator_traits
<Alloc
>::deallocate(a
, &a
.storage
, 10);
67 static_assert(test());