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 // <memory>
10 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 //
12 // template <class T>
13 // class allocator
14 // {
15 // public: // All of these are constexpr after C++17
16 //  constexpr allocator() noexcept;
17 //  constexpr allocator(const allocator&) noexcept;
18 //  template<class U> constexpr allocator(const allocator<U>&) noexcept;
19 // ...
20 // };
21 
22 #include <memory>
23 #include <cstddef>
24 
25 #include "test_macros.h"
26 
27 
main(int,char **)28 int main(int, char**)
29 {
30     {
31     typedef std::allocator<char> AC;
32     typedef std::allocator<long> AL;
33 
34     constexpr AC a1;
35     constexpr AC a2{a1};
36     constexpr AL a3{a2};
37     (void) a3;
38     }
39     {
40     typedef std::allocator<const char> AC;
41     typedef std::allocator<const long> AL;
42 
43     constexpr AC a1;
44     constexpr AC a2{a1};
45     constexpr AL a3{a2};
46     (void) a3;
47     }
48 
49 
50   return 0;
51 }
52