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// <vector>
13
14// Test the feature test macros defined by <vector>
15
16// clang-format off
17
18#include <vector>
19#include "test_macros.h"
20
21#if TEST_STD_VER < 14
22
23# ifdef __cpp_lib_allocator_traits_is_always_equal
24# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
25# endif
26
27# ifdef __cpp_lib_constexpr_vector
28# error "__cpp_lib_constexpr_vector should not be defined before c++20"
29# endif
30
31# ifdef __cpp_lib_containers_ranges
32# error "__cpp_lib_containers_ranges should not be defined before c++23"
33# endif
34
35# ifdef __cpp_lib_default_template_type_for_algorithm_values
36# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
37# endif
38
39# ifdef __cpp_lib_erase_if
40# error "__cpp_lib_erase_if should not be defined before c++20"
41# endif
42
43# ifdef __cpp_lib_incomplete_container_elements
44# error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
45# endif
46
47# ifdef __cpp_lib_nonmember_container_access
48# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
49# endif
50
51#elif TEST_STD_VER == 14
52
53# ifdef __cpp_lib_allocator_traits_is_always_equal
54# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
55# endif
56
57# ifdef __cpp_lib_constexpr_vector
58# error "__cpp_lib_constexpr_vector should not be defined before c++20"
59# endif
60
61# ifdef __cpp_lib_containers_ranges
62# error "__cpp_lib_containers_ranges should not be defined before c++23"
63# endif
64
65# ifdef __cpp_lib_default_template_type_for_algorithm_values
66# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
67# endif
68
69# ifdef __cpp_lib_erase_if
70# error "__cpp_lib_erase_if should not be defined before c++20"
71# endif
72
73# ifdef __cpp_lib_incomplete_container_elements
74# error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
75# endif
76
77# ifdef __cpp_lib_nonmember_container_access
78# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
79# endif
80
81#elif TEST_STD_VER == 17
82
83# ifndef __cpp_lib_allocator_traits_is_always_equal
84# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
85# endif
86# if __cpp_lib_allocator_traits_is_always_equal != 201411L
87# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
88# endif
89
90# ifdef __cpp_lib_constexpr_vector
91# error "__cpp_lib_constexpr_vector should not be defined before c++20"
92# endif
93
94# ifdef __cpp_lib_containers_ranges
95# error "__cpp_lib_containers_ranges should not be defined before c++23"
96# endif
97
98# ifdef __cpp_lib_default_template_type_for_algorithm_values
99# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
100# endif
101
102# ifdef __cpp_lib_erase_if
103# error "__cpp_lib_erase_if should not be defined before c++20"
104# endif
105
106# ifndef __cpp_lib_incomplete_container_elements
107# error "__cpp_lib_incomplete_container_elements should be defined in c++17"
108# endif
109# if __cpp_lib_incomplete_container_elements != 201505L
110# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
111# endif
112
113# ifndef __cpp_lib_nonmember_container_access
114# error "__cpp_lib_nonmember_container_access should be defined in c++17"
115# endif
116# if __cpp_lib_nonmember_container_access != 201411L
117# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
118# endif
119
120#elif TEST_STD_VER == 20
121
122# ifndef __cpp_lib_allocator_traits_is_always_equal
123# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
124# endif
125# if __cpp_lib_allocator_traits_is_always_equal != 201411L
126# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
127# endif
128
129# ifndef __cpp_lib_constexpr_vector
130# error "__cpp_lib_constexpr_vector should be defined in c++20"
131# endif
132# if __cpp_lib_constexpr_vector != 201907L
133# error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
134# endif
135
136# ifdef __cpp_lib_containers_ranges
137# error "__cpp_lib_containers_ranges should not be defined before c++23"
138# endif
139
140# ifdef __cpp_lib_default_template_type_for_algorithm_values
141# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
142# endif
143
144# ifndef __cpp_lib_erase_if
145# error "__cpp_lib_erase_if should be defined in c++20"
146# endif
147# if __cpp_lib_erase_if != 202002L
148# error "__cpp_lib_erase_if should have the value 202002L in c++20"
149# endif
150
151# ifndef __cpp_lib_incomplete_container_elements
152# error "__cpp_lib_incomplete_container_elements should be defined in c++20"
153# endif
154# if __cpp_lib_incomplete_container_elements != 201505L
155# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
156# endif
157
158# ifndef __cpp_lib_nonmember_container_access
159# error "__cpp_lib_nonmember_container_access should be defined in c++20"
160# endif
161# if __cpp_lib_nonmember_container_access != 201411L
162# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
163# endif
164
165#elif TEST_STD_VER == 23
166
167# ifndef __cpp_lib_allocator_traits_is_always_equal
168# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
169# endif
170# if __cpp_lib_allocator_traits_is_always_equal != 201411L
171# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
172# endif
173
174# ifndef __cpp_lib_constexpr_vector
175# error "__cpp_lib_constexpr_vector should be defined in c++23"
176# endif
177# if __cpp_lib_constexpr_vector != 201907L
178# error "__cpp_lib_constexpr_vector should have the value 201907L in c++23"
179# endif
180
181# ifndef __cpp_lib_containers_ranges
182# error "__cpp_lib_containers_ranges should be defined in c++23"
183# endif
184# if __cpp_lib_containers_ranges != 202202L
185# error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
186# endif
187
188# ifdef __cpp_lib_default_template_type_for_algorithm_values
189# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
190# endif
191
192# ifndef __cpp_lib_erase_if
193# error "__cpp_lib_erase_if should be defined in c++23"
194# endif
195# if __cpp_lib_erase_if != 202002L
196# error "__cpp_lib_erase_if should have the value 202002L in c++23"
197# endif
198
199# ifndef __cpp_lib_incomplete_container_elements
200# error "__cpp_lib_incomplete_container_elements should be defined in c++23"
201# endif
202# if __cpp_lib_incomplete_container_elements != 201505L
203# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
204# endif
205
206# ifndef __cpp_lib_nonmember_container_access
207# error "__cpp_lib_nonmember_container_access should be defined in c++23"
208# endif
209# if __cpp_lib_nonmember_container_access != 201411L
210# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
211# endif
212
213#elif TEST_STD_VER > 23
214
215# ifndef __cpp_lib_allocator_traits_is_always_equal
216# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
217# endif
218# if __cpp_lib_allocator_traits_is_always_equal != 201411L
219# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
220# endif
221
222# ifndef __cpp_lib_constexpr_vector
223# error "__cpp_lib_constexpr_vector should be defined in c++26"
224# endif
225# if __cpp_lib_constexpr_vector != 201907L
226# error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
227# endif
228
229# ifndef __cpp_lib_containers_ranges
230# error "__cpp_lib_containers_ranges should be defined in c++26"
231# endif
232# if __cpp_lib_containers_ranges != 202202L
233# error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
234# endif
235
236# if !defined(_LIBCPP_VERSION)
237# ifndef __cpp_lib_default_template_type_for_algorithm_values
238# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
239# endif
240# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
241# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
242# endif
243# else
244# ifdef __cpp_lib_default_template_type_for_algorithm_values
245# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
246# endif
247# endif
248
249# ifndef __cpp_lib_erase_if
250# error "__cpp_lib_erase_if should be defined in c++26"
251# endif
252# if __cpp_lib_erase_if != 202002L
253# error "__cpp_lib_erase_if should have the value 202002L in c++26"
254# endif
255
256# ifndef __cpp_lib_incomplete_container_elements
257# error "__cpp_lib_incomplete_container_elements should be defined in c++26"
258# endif
259# if __cpp_lib_incomplete_container_elements != 201505L
260# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
261# endif
262
263# ifndef __cpp_lib_nonmember_container_access
264# error "__cpp_lib_nonmember_container_access should be defined in c++26"
265# endif
266# if __cpp_lib_nonmember_container_access != 201411L
267# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
268# endif
269
270#endif // TEST_STD_VER > 23
271
272// clang-format on
273
274

source code of libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp