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 // <list>
15 
16 // Test the feature test macros defined by <list>
17 
18 /*  Constant                                      Value
19     __cpp_lib_allocator_traits_is_always_equal    201411L [C++17]
20     __cpp_lib_erase_if                            202002L [C++20]
21     __cpp_lib_incomplete_container_elements       201505L [C++17]
22     __cpp_lib_list_remove_return_type             201806L [C++20]
23     __cpp_lib_nonmember_container_access          201411L [C++17]
24     __cpp_lib_ranges_to_container                 202202L [C++2b]
25 */
26 
27 #include <list>
28 #include "test_macros.h"
29 
30 #if TEST_STD_VER < 14
31 
32 # ifdef __cpp_lib_allocator_traits_is_always_equal
33 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
34 # endif
35 
36 # ifdef __cpp_lib_erase_if
37 #   error "__cpp_lib_erase_if should not be defined before c++20"
38 # endif
39 
40 # ifdef __cpp_lib_incomplete_container_elements
41 #   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
42 # endif
43 
44 # ifdef __cpp_lib_list_remove_return_type
45 #   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
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_ranges_to_container
53 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
54 # endif
55 
56 #elif TEST_STD_VER == 14
57 
58 # ifdef __cpp_lib_allocator_traits_is_always_equal
59 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
60 # endif
61 
62 # ifdef __cpp_lib_erase_if
63 #   error "__cpp_lib_erase_if should not be defined before c++20"
64 # endif
65 
66 # ifdef __cpp_lib_incomplete_container_elements
67 #   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
68 # endif
69 
70 # ifdef __cpp_lib_list_remove_return_type
71 #   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
72 # endif
73 
74 # ifdef __cpp_lib_nonmember_container_access
75 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
76 # endif
77 
78 # ifdef __cpp_lib_ranges_to_container
79 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
80 # endif
81 
82 #elif TEST_STD_VER == 17
83 
84 # ifndef __cpp_lib_allocator_traits_is_always_equal
85 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
86 # endif
87 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
88 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
89 # endif
90 
91 # ifdef __cpp_lib_erase_if
92 #   error "__cpp_lib_erase_if should not be defined before c++20"
93 # endif
94 
95 # ifndef __cpp_lib_incomplete_container_elements
96 #   error "__cpp_lib_incomplete_container_elements should be defined in c++17"
97 # endif
98 # if __cpp_lib_incomplete_container_elements != 201505L
99 #   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
100 # endif
101 
102 # ifdef __cpp_lib_list_remove_return_type
103 #   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
104 # endif
105 
106 # ifndef __cpp_lib_nonmember_container_access
107 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
108 # endif
109 # if __cpp_lib_nonmember_container_access != 201411L
110 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
111 # endif
112 
113 # ifdef __cpp_lib_ranges_to_container
114 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
115 # endif
116 
117 #elif TEST_STD_VER == 20
118 
119 # ifndef __cpp_lib_allocator_traits_is_always_equal
120 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
121 # endif
122 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
123 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
124 # endif
125 
126 # ifndef __cpp_lib_erase_if
127 #   error "__cpp_lib_erase_if should be defined in c++20"
128 # endif
129 # if __cpp_lib_erase_if != 202002L
130 #   error "__cpp_lib_erase_if should have the value 202002L in c++20"
131 # endif
132 
133 # ifndef __cpp_lib_incomplete_container_elements
134 #   error "__cpp_lib_incomplete_container_elements should be defined in c++20"
135 # endif
136 # if __cpp_lib_incomplete_container_elements != 201505L
137 #   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
138 # endif
139 
140 # ifndef __cpp_lib_list_remove_return_type
141 #   error "__cpp_lib_list_remove_return_type should be defined in c++20"
142 # endif
143 # if __cpp_lib_list_remove_return_type != 201806L
144 #   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
145 # endif
146 
147 # ifndef __cpp_lib_nonmember_container_access
148 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
149 # endif
150 # if __cpp_lib_nonmember_container_access != 201411L
151 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
152 # endif
153 
154 # ifdef __cpp_lib_ranges_to_container
155 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
156 # endif
157 
158 #elif TEST_STD_VER > 20
159 
160 # ifndef __cpp_lib_allocator_traits_is_always_equal
161 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2b"
162 # endif
163 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
164 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2b"
165 # endif
166 
167 # ifndef __cpp_lib_erase_if
168 #   error "__cpp_lib_erase_if should be defined in c++2b"
169 # endif
170 # if __cpp_lib_erase_if != 202002L
171 #   error "__cpp_lib_erase_if should have the value 202002L in c++2b"
172 # endif
173 
174 # ifndef __cpp_lib_incomplete_container_elements
175 #   error "__cpp_lib_incomplete_container_elements should be defined in c++2b"
176 # endif
177 # if __cpp_lib_incomplete_container_elements != 201505L
178 #   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++2b"
179 # endif
180 
181 # ifndef __cpp_lib_list_remove_return_type
182 #   error "__cpp_lib_list_remove_return_type should be defined in c++2b"
183 # endif
184 # if __cpp_lib_list_remove_return_type != 201806L
185 #   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++2b"
186 # endif
187 
188 # ifndef __cpp_lib_nonmember_container_access
189 #   error "__cpp_lib_nonmember_container_access should be defined in c++2b"
190 # endif
191 # if __cpp_lib_nonmember_container_access != 201411L
192 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2b"
193 # endif
194 
195 # if !defined(_LIBCPP_VERSION)
196 #   ifndef __cpp_lib_ranges_to_container
197 #     error "__cpp_lib_ranges_to_container should be defined in c++2b"
198 #   endif
199 #   if __cpp_lib_ranges_to_container != 202202L
200 #     error "__cpp_lib_ranges_to_container should have the value 202202L in c++2b"
201 #   endif
202 # else // _LIBCPP_VERSION
203 #   ifdef __cpp_lib_ranges_to_container
204 #     error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!"
205 #   endif
206 # endif
207 
208 #endif // TEST_STD_VER > 20
209 
210