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_freestanding_array            202311L [C++26]
22     __cpp_lib_nonmember_container_access    201411L [C++17]
23     __cpp_lib_to_array                      201907L [C++20]
24 */
25 
26 #include <array>
27 #include "test_macros.h"
28 
29 #if TEST_STD_VER < 14
30 
31 # ifdef __cpp_lib_array_constexpr
32 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
33 # endif
34 
35 # ifdef __cpp_lib_freestanding_array
36 #   error "__cpp_lib_freestanding_array should not be defined before c++26"
37 # endif
38 
39 # ifdef __cpp_lib_nonmember_container_access
40 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
41 # endif
42 
43 # ifdef __cpp_lib_to_array
44 #   error "__cpp_lib_to_array should not be defined before c++20"
45 # endif
46 
47 #elif TEST_STD_VER == 14
48 
49 # ifdef __cpp_lib_array_constexpr
50 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
51 # endif
52 
53 # ifdef __cpp_lib_freestanding_array
54 #   error "__cpp_lib_freestanding_array should not be defined before c++26"
55 # endif
56 
57 # ifdef __cpp_lib_nonmember_container_access
58 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
59 # endif
60 
61 # ifdef __cpp_lib_to_array
62 #   error "__cpp_lib_to_array should not be defined before c++20"
63 # endif
64 
65 #elif TEST_STD_VER == 17
66 
67 # ifndef __cpp_lib_array_constexpr
68 #   error "__cpp_lib_array_constexpr should be defined in c++17"
69 # endif
70 # if __cpp_lib_array_constexpr != 201603L
71 #   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
72 # endif
73 
74 # ifdef __cpp_lib_freestanding_array
75 #   error "__cpp_lib_freestanding_array should not be defined before c++26"
76 # endif
77 
78 # ifndef __cpp_lib_nonmember_container_access
79 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
80 # endif
81 # if __cpp_lib_nonmember_container_access != 201411L
82 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
83 # endif
84 
85 # ifdef __cpp_lib_to_array
86 #   error "__cpp_lib_to_array should not be defined before c++20"
87 # endif
88 
89 #elif TEST_STD_VER == 20
90 
91 # ifndef __cpp_lib_array_constexpr
92 #   error "__cpp_lib_array_constexpr should be defined in c++20"
93 # endif
94 # if __cpp_lib_array_constexpr != 201811L
95 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
96 # endif
97 
98 # ifdef __cpp_lib_freestanding_array
99 #   error "__cpp_lib_freestanding_array should not be defined before c++26"
100 # endif
101 
102 # ifndef __cpp_lib_nonmember_container_access
103 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
104 # endif
105 # if __cpp_lib_nonmember_container_access != 201411L
106 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
107 # endif
108 
109 # ifndef __cpp_lib_to_array
110 #   error "__cpp_lib_to_array should be defined in c++20"
111 # endif
112 # if __cpp_lib_to_array != 201907L
113 #   error "__cpp_lib_to_array should have the value 201907L in c++20"
114 # endif
115 
116 #elif TEST_STD_VER == 23
117 
118 # ifndef __cpp_lib_array_constexpr
119 #   error "__cpp_lib_array_constexpr should be defined in c++23"
120 # endif
121 # if __cpp_lib_array_constexpr != 201811L
122 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
123 # endif
124 
125 # ifdef __cpp_lib_freestanding_array
126 #   error "__cpp_lib_freestanding_array should not be defined before c++26"
127 # endif
128 
129 # ifndef __cpp_lib_nonmember_container_access
130 #   error "__cpp_lib_nonmember_container_access should be defined in c++23"
131 # endif
132 # if __cpp_lib_nonmember_container_access != 201411L
133 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
134 # endif
135 
136 # ifndef __cpp_lib_to_array
137 #   error "__cpp_lib_to_array should be defined in c++23"
138 # endif
139 # if __cpp_lib_to_array != 201907L
140 #   error "__cpp_lib_to_array should have the value 201907L in c++23"
141 # endif
142 
143 #elif TEST_STD_VER > 23
144 
145 # ifndef __cpp_lib_array_constexpr
146 #   error "__cpp_lib_array_constexpr should be defined in c++26"
147 # endif
148 # if __cpp_lib_array_constexpr != 201811L
149 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
150 # endif
151 
152 # if !defined(_LIBCPP_VERSION)
153 #   ifndef __cpp_lib_freestanding_array
154 #     error "__cpp_lib_freestanding_array should be defined in c++26"
155 #   endif
156 #   if __cpp_lib_freestanding_array != 202311L
157 #     error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
158 #   endif
159 # else // _LIBCPP_VERSION
160 #   ifdef __cpp_lib_freestanding_array
161 #     error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
162 #   endif
163 # endif
164 
165 # ifndef __cpp_lib_nonmember_container_access
166 #   error "__cpp_lib_nonmember_container_access should be defined in c++26"
167 # endif
168 # if __cpp_lib_nonmember_container_access != 201411L
169 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
170 # endif
171 
172 # ifndef __cpp_lib_to_array
173 #   error "__cpp_lib_to_array should be defined in c++26"
174 # endif
175 # if __cpp_lib_to_array != 201907L
176 #   error "__cpp_lib_to_array should have the value 201907L in c++26"
177 # endif
178 
179 #endif // TEST_STD_VER > 23
180 
181