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 // WARNING: This test was generated by generate_feature_test_macro_components.py
10 // and should not be edited manually.
11 //
12 // clang-format off
13 
14 // <array>
15 
16 // Test the feature test macros defined by <array>
17 
18 /*  Constant                                Value
19     __cpp_lib_array_constexpr               201603L [C++17]
20                                             201811L [C++20]
21     __cpp_lib_nonmember_container_access    201411L [C++17]
22     __cpp_lib_to_array                      201907L [C++20]
23 */
24 
25 #include <array>
26 #include "test_macros.h"
27 
28 #if TEST_STD_VER < 14
29 
30 # ifdef __cpp_lib_array_constexpr
31 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
32 # endif
33 
34 # ifdef __cpp_lib_nonmember_container_access
35 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
36 # endif
37 
38 # ifdef __cpp_lib_to_array
39 #   error "__cpp_lib_to_array should not be defined before c++20"
40 # endif
41 
42 #elif TEST_STD_VER == 14
43 
44 # ifdef __cpp_lib_array_constexpr
45 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
46 # endif
47 
48 # ifdef __cpp_lib_nonmember_container_access
49 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
50 # endif
51 
52 # ifdef __cpp_lib_to_array
53 #   error "__cpp_lib_to_array should not be defined before c++20"
54 # endif
55 
56 #elif TEST_STD_VER == 17
57 
58 # ifndef __cpp_lib_array_constexpr
59 #   error "__cpp_lib_array_constexpr should be defined in c++17"
60 # endif
61 # if __cpp_lib_array_constexpr != 201603L
62 #   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
63 # endif
64 
65 # ifndef __cpp_lib_nonmember_container_access
66 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
67 # endif
68 # if __cpp_lib_nonmember_container_access != 201411L
69 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
70 # endif
71 
72 # ifdef __cpp_lib_to_array
73 #   error "__cpp_lib_to_array should not be defined before c++20"
74 # endif
75 
76 #elif TEST_STD_VER == 20
77 
78 # ifndef __cpp_lib_array_constexpr
79 #   error "__cpp_lib_array_constexpr should be defined in c++20"
80 # endif
81 # if __cpp_lib_array_constexpr != 201811L
82 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
83 # endif
84 
85 # ifndef __cpp_lib_nonmember_container_access
86 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
87 # endif
88 # if __cpp_lib_nonmember_container_access != 201411L
89 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
90 # endif
91 
92 # ifndef __cpp_lib_to_array
93 #   error "__cpp_lib_to_array should be defined in c++20"
94 # endif
95 # if __cpp_lib_to_array != 201907L
96 #   error "__cpp_lib_to_array should have the value 201907L in c++20"
97 # endif
98 
99 #elif TEST_STD_VER > 20
100 
101 # ifndef __cpp_lib_array_constexpr
102 #   error "__cpp_lib_array_constexpr should be defined in c++23"
103 # endif
104 # if __cpp_lib_array_constexpr != 201811L
105 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
106 # endif
107 
108 # ifndef __cpp_lib_nonmember_container_access
109 #   error "__cpp_lib_nonmember_container_access should be defined in c++23"
110 # endif
111 # if __cpp_lib_nonmember_container_access != 201411L
112 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
113 # endif
114 
115 # ifndef __cpp_lib_to_array
116 #   error "__cpp_lib_to_array should be defined in c++23"
117 # endif
118 # if __cpp_lib_to_array != 201907L
119 #   error "__cpp_lib_to_array should have the value 201907L in c++23"
120 # endif
121 
122 #endif // TEST_STD_VER > 20
123 
124