1//===----------------------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03, c++11, c++14, c++17
10
11// template <class T>
12// constexpr allocator<T>::~allocator();
13
14#include <memory>
15
16template <typename T>
17constexpr bool test() {
18 std::allocator<T> alloc;
19 (void)alloc;
20
21 // destructor called here
22 return true;
23}
24
25int main(int, char**)
26{
27 test<int>();
28 test<void>();
29#ifdef _LIBCPP_VERSION // extension
30 test<int const>();
31#endif // _LIBCPP_VERSION
32
33 static_assert(test<int>());
34 static_assert(test<void>());
35#ifdef _LIBCPP_VERSION // extension
36 static_assert(test<int const>());
37#endif // _LIBCPP_VERSION
38
39 return 0;
40}
41

source code of libcxx/test/std/utilities/memory/default.allocator/allocator.dtor.pass.cpp