algorithm.version.pass.cpp (6162B)
1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // WARNING: This test was generated by generate_feature_test_macro_components.py 11 // and should not be edited manually. 12 13 // <algorithm> 14 15 // Test the feature test macros defined by <algorithm> 16 17 /* Constant Value 18 __cpp_lib_clamp 201603L [C++17] 19 __cpp_lib_constexpr_swap_algorithms 201806L [C++2a] 20 __cpp_lib_parallel_algorithm 201603L [C++17] 21 __cpp_lib_ranges 201811L [C++2a] 22 __cpp_lib_robust_nonmodifying_seq_ops 201304L [C++14] 23 __cpp_lib_sample 201603L [C++17] 24 */ 25 26 #include <algorithm> 27 #include "test_macros.h" 28 29 #if TEST_STD_VER < 14 30 31 # ifdef __cpp_lib_clamp 32 # error "__cpp_lib_clamp should not be defined before c++17" 33 # endif 34 35 # ifdef __cpp_lib_constexpr_swap_algorithms 36 # error "__cpp_lib_constexpr_swap_algorithms should not be defined before c++2a" 37 # endif 38 39 # ifdef __cpp_lib_parallel_algorithm 40 # error "__cpp_lib_parallel_algorithm should not be defined before c++17" 41 # endif 42 43 # ifdef __cpp_lib_ranges 44 # error "__cpp_lib_ranges should not be defined before c++2a" 45 # endif 46 47 # ifdef __cpp_lib_robust_nonmodifying_seq_ops 48 # error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14" 49 # endif 50 51 # ifdef __cpp_lib_sample 52 # error "__cpp_lib_sample should not be defined before c++17" 53 # endif 54 55 #elif TEST_STD_VER == 14 56 57 # ifdef __cpp_lib_clamp 58 # error "__cpp_lib_clamp should not be defined before c++17" 59 # endif 60 61 # ifdef __cpp_lib_constexpr_swap_algorithms 62 # error "__cpp_lib_constexpr_swap_algorithms should not be defined before c++2a" 63 # endif 64 65 # ifdef __cpp_lib_parallel_algorithm 66 # error "__cpp_lib_parallel_algorithm should not be defined before c++17" 67 # endif 68 69 # ifdef __cpp_lib_ranges 70 # error "__cpp_lib_ranges should not be defined before c++2a" 71 # endif 72 73 # ifndef __cpp_lib_robust_nonmodifying_seq_ops 74 # error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14" 75 # endif 76 # if __cpp_lib_robust_nonmodifying_seq_ops != 201304L 77 # error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14" 78 # endif 79 80 # ifdef __cpp_lib_sample 81 # error "__cpp_lib_sample should not be defined before c++17" 82 # endif 83 84 #elif TEST_STD_VER == 17 85 86 # ifndef __cpp_lib_clamp 87 # error "__cpp_lib_clamp should be defined in c++17" 88 # endif 89 # if __cpp_lib_clamp != 201603L 90 # error "__cpp_lib_clamp should have the value 201603L in c++17" 91 # endif 92 93 # ifdef __cpp_lib_constexpr_swap_algorithms 94 # error "__cpp_lib_constexpr_swap_algorithms should not be defined before c++2a" 95 # endif 96 97 # if !defined(_LIBCPP_VERSION) 98 # ifndef __cpp_lib_parallel_algorithm 99 # error "__cpp_lib_parallel_algorithm should be defined in c++17" 100 # endif 101 # if __cpp_lib_parallel_algorithm != 201603L 102 # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" 103 # endif 104 # else // _LIBCPP_VERSION 105 # ifdef __cpp_lib_parallel_algorithm 106 # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" 107 # endif 108 # endif 109 110 # ifdef __cpp_lib_ranges 111 # error "__cpp_lib_ranges should not be defined before c++2a" 112 # endif 113 114 # ifndef __cpp_lib_robust_nonmodifying_seq_ops 115 # error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17" 116 # endif 117 # if __cpp_lib_robust_nonmodifying_seq_ops != 201304L 118 # error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17" 119 # endif 120 121 # ifndef __cpp_lib_sample 122 # error "__cpp_lib_sample should be defined in c++17" 123 # endif 124 # if __cpp_lib_sample != 201603L 125 # error "__cpp_lib_sample should have the value 201603L in c++17" 126 # endif 127 128 #elif TEST_STD_VER > 17 129 130 # ifndef __cpp_lib_clamp 131 # error "__cpp_lib_clamp should be defined in c++2a" 132 # endif 133 # if __cpp_lib_clamp != 201603L 134 # error "__cpp_lib_clamp should have the value 201603L in c++2a" 135 # endif 136 137 # if !defined(_LIBCPP_VERSION) 138 # ifndef __cpp_lib_constexpr_swap_algorithms 139 # error "__cpp_lib_constexpr_swap_algorithms should be defined in c++2a" 140 # endif 141 # if __cpp_lib_constexpr_swap_algorithms != 201806L 142 # error "__cpp_lib_constexpr_swap_algorithms should have the value 201806L in c++2a" 143 # endif 144 # else // _LIBCPP_VERSION 145 # ifdef __cpp_lib_constexpr_swap_algorithms 146 # error "__cpp_lib_constexpr_swap_algorithms should not be defined because it is unimplemented in libc++!" 147 # endif 148 # endif 149 150 # if !defined(_LIBCPP_VERSION) 151 # ifndef __cpp_lib_parallel_algorithm 152 # error "__cpp_lib_parallel_algorithm should be defined in c++2a" 153 # endif 154 # if __cpp_lib_parallel_algorithm != 201603L 155 # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2a" 156 # endif 157 # else // _LIBCPP_VERSION 158 # ifdef __cpp_lib_parallel_algorithm 159 # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" 160 # endif 161 # endif 162 163 # if !defined(_LIBCPP_VERSION) 164 # ifndef __cpp_lib_ranges 165 # error "__cpp_lib_ranges should be defined in c++2a" 166 # endif 167 # if __cpp_lib_ranges != 201811L 168 # error "__cpp_lib_ranges should have the value 201811L in c++2a" 169 # endif 170 # else // _LIBCPP_VERSION 171 # ifdef __cpp_lib_ranges 172 # error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!" 173 # endif 174 # endif 175 176 # ifndef __cpp_lib_robust_nonmodifying_seq_ops 177 # error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++2a" 178 # endif 179 # if __cpp_lib_robust_nonmodifying_seq_ops != 201304L 180 # error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++2a" 181 # endif 182 183 # ifndef __cpp_lib_sample 184 # error "__cpp_lib_sample should be defined in c++2a" 185 # endif 186 # if __cpp_lib_sample != 201603L 187 # error "__cpp_lib_sample should have the value 201603L in c++2a" 188 # endif 189 190 #endif // TEST_STD_VER > 17 191 192 int main() {}