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