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