[flang][OpenMP] Use range-for to iterate over SymbolSourceMap, NFC
[llvm-project.git] / libcxx / test / std / utilities / memory / default.allocator / allocator.ctor.pass.cpp
bloba278bc41ef7614f67bf278cfe98d2c22c79ade19
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 //===----------------------------------------------------------------------===//
9 // <memory>
11 // template <class T>
12 // class allocator
13 // {
14 // public: // All of these are constexpr after C++17
15 // allocator() noexcept;
16 // allocator(const allocator&) noexcept;
17 // template<class U> allocator(const allocator<U>&) noexcept;
18 // ...
19 // };
21 #include <memory>
22 #include <cstddef>
24 #include "test_macros.h"
26 template<class T>
27 TEST_CONSTEXPR_CXX20 bool test() {
28 typedef std::allocator<T> A1;
29 typedef std::allocator<long> A2;
31 A1 a1;
32 A1 a1_copy = a1; (void)a1_copy;
33 A2 a2 = a1; (void)a2;
35 return true;
38 int main(int, char**) {
39 test<char>();
40 test<int>();
41 test<void>();
43 #if TEST_STD_VER > 17
44 static_assert(test<char>());
45 static_assert(test<int>());
46 static_assert(test<void>());
47 #endif
48 return 0;