xref: /llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.dtor.pass.cpp (revision eb12d9b5cb6d15ce151a63ad32b4e0e5823ddb87)
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 
16 template <typename T>
test()17 constexpr bool test() {
18     std::allocator<T> alloc;
19     (void)alloc;
20 
21     // destructor called here
22     return true;
23 }
24 
main(int,char **)25 int main(int, char**)
26 {
27     test<int>();
28     test<void>();
29 
30     static_assert(test<int>());
31     static_assert(test<void>());
32 
33     return 0;
34 }
35