memory.version.pass.cpp (8554B)
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 // <memory> 14 15 // Test the feature test macros defined by <memory> 16 17 /* Constant Value 18 __cpp_lib_addressof_constexpr 201603L [C++17] 19 __cpp_lib_allocator_traits_is_always_equal 201411L [C++17] 20 __cpp_lib_enable_shared_from_this 201603L [C++17] 21 __cpp_lib_make_unique 201304L [C++14] 22 __cpp_lib_ranges 201811L [C++2a] 23 __cpp_lib_raw_memory_algorithms 201606L [C++17] 24 __cpp_lib_shared_ptr_arrays 201611L [C++17] 25 __cpp_lib_shared_ptr_weak_type 201606L [C++17] 26 */ 27 28 #include <memory> 29 #include "test_macros.h" 30 31 #if TEST_STD_VER < 14 32 33 # ifdef __cpp_lib_addressof_constexpr 34 # error "__cpp_lib_addressof_constexpr should not be defined before c++17" 35 # endif 36 37 # ifdef __cpp_lib_allocator_traits_is_always_equal 38 # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" 39 # endif 40 41 # ifdef __cpp_lib_enable_shared_from_this 42 # error "__cpp_lib_enable_shared_from_this should not be defined before c++17" 43 # endif 44 45 # ifdef __cpp_lib_make_unique 46 # error "__cpp_lib_make_unique should not be defined before c++14" 47 # endif 48 49 # ifdef __cpp_lib_ranges 50 # error "__cpp_lib_ranges should not be defined before c++2a" 51 # endif 52 53 # ifdef __cpp_lib_raw_memory_algorithms 54 # error "__cpp_lib_raw_memory_algorithms should not be defined before c++17" 55 # endif 56 57 # ifdef __cpp_lib_shared_ptr_arrays 58 # error "__cpp_lib_shared_ptr_arrays should not be defined before c++17" 59 # endif 60 61 # ifdef __cpp_lib_shared_ptr_weak_type 62 # error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17" 63 # endif 64 65 #elif TEST_STD_VER == 14 66 67 # ifdef __cpp_lib_addressof_constexpr 68 # error "__cpp_lib_addressof_constexpr should not be defined before c++17" 69 # endif 70 71 # ifdef __cpp_lib_allocator_traits_is_always_equal 72 # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" 73 # endif 74 75 # ifdef __cpp_lib_enable_shared_from_this 76 # error "__cpp_lib_enable_shared_from_this should not be defined before c++17" 77 # endif 78 79 # ifndef __cpp_lib_make_unique 80 # error "__cpp_lib_make_unique should be defined in c++14" 81 # endif 82 # if __cpp_lib_make_unique != 201304L 83 # error "__cpp_lib_make_unique should have the value 201304L in c++14" 84 # endif 85 86 # ifdef __cpp_lib_ranges 87 # error "__cpp_lib_ranges should not be defined before c++2a" 88 # endif 89 90 # ifdef __cpp_lib_raw_memory_algorithms 91 # error "__cpp_lib_raw_memory_algorithms should not be defined before c++17" 92 # endif 93 94 # ifdef __cpp_lib_shared_ptr_arrays 95 # error "__cpp_lib_shared_ptr_arrays should not be defined before c++17" 96 # endif 97 98 # ifdef __cpp_lib_shared_ptr_weak_type 99 # error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17" 100 # endif 101 102 #elif TEST_STD_VER == 17 103 104 # if TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700 105 # ifndef __cpp_lib_addressof_constexpr 106 # error "__cpp_lib_addressof_constexpr should be defined in c++17" 107 # endif 108 # if __cpp_lib_addressof_constexpr != 201603L 109 # error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17" 110 # endif 111 # else 112 # ifdef __cpp_lib_addressof_constexpr 113 # error "__cpp_lib_addressof_constexpr should not be defined when TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700 is not defined!" 114 # endif 115 # endif 116 117 # ifndef __cpp_lib_allocator_traits_is_always_equal 118 # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" 119 # endif 120 # if __cpp_lib_allocator_traits_is_always_equal != 201411L 121 # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" 122 # endif 123 124 # ifndef __cpp_lib_enable_shared_from_this 125 # error "__cpp_lib_enable_shared_from_this should be defined in c++17" 126 # endif 127 # if __cpp_lib_enable_shared_from_this != 201603L 128 # error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17" 129 # endif 130 131 # ifndef __cpp_lib_make_unique 132 # error "__cpp_lib_make_unique should be defined in c++17" 133 # endif 134 # if __cpp_lib_make_unique != 201304L 135 # error "__cpp_lib_make_unique should have the value 201304L in c++17" 136 # endif 137 138 # ifdef __cpp_lib_ranges 139 # error "__cpp_lib_ranges should not be defined before c++2a" 140 # endif 141 142 # ifndef __cpp_lib_raw_memory_algorithms 143 # error "__cpp_lib_raw_memory_algorithms should be defined in c++17" 144 # endif 145 # if __cpp_lib_raw_memory_algorithms != 201606L 146 # error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17" 147 # endif 148 149 # if !defined(_LIBCPP_VERSION) 150 # ifndef __cpp_lib_shared_ptr_arrays 151 # error "__cpp_lib_shared_ptr_arrays should be defined in c++17" 152 # endif 153 # if __cpp_lib_shared_ptr_arrays != 201611L 154 # error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17" 155 # endif 156 # else // _LIBCPP_VERSION 157 # ifdef __cpp_lib_shared_ptr_arrays 158 # error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!" 159 # endif 160 # endif 161 162 # ifndef __cpp_lib_shared_ptr_weak_type 163 # error "__cpp_lib_shared_ptr_weak_type should be defined in c++17" 164 # endif 165 # if __cpp_lib_shared_ptr_weak_type != 201606L 166 # error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17" 167 # endif 168 169 #elif TEST_STD_VER > 17 170 171 # if TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700 172 # ifndef __cpp_lib_addressof_constexpr 173 # error "__cpp_lib_addressof_constexpr should be defined in c++2a" 174 # endif 175 # if __cpp_lib_addressof_constexpr != 201603L 176 # error "__cpp_lib_addressof_constexpr should have the value 201603L in c++2a" 177 # endif 178 # else 179 # ifdef __cpp_lib_addressof_constexpr 180 # error "__cpp_lib_addressof_constexpr should not be defined when TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700 is not defined!" 181 # endif 182 # endif 183 184 # ifndef __cpp_lib_allocator_traits_is_always_equal 185 # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2a" 186 # endif 187 # if __cpp_lib_allocator_traits_is_always_equal != 201411L 188 # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2a" 189 # endif 190 191 # ifndef __cpp_lib_enable_shared_from_this 192 # error "__cpp_lib_enable_shared_from_this should be defined in c++2a" 193 # endif 194 # if __cpp_lib_enable_shared_from_this != 201603L 195 # error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++2a" 196 # endif 197 198 # ifndef __cpp_lib_make_unique 199 # error "__cpp_lib_make_unique should be defined in c++2a" 200 # endif 201 # if __cpp_lib_make_unique != 201304L 202 # error "__cpp_lib_make_unique should have the value 201304L in c++2a" 203 # endif 204 205 # if !defined(_LIBCPP_VERSION) 206 # ifndef __cpp_lib_ranges 207 # error "__cpp_lib_ranges should be defined in c++2a" 208 # endif 209 # if __cpp_lib_ranges != 201811L 210 # error "__cpp_lib_ranges should have the value 201811L in c++2a" 211 # endif 212 # else // _LIBCPP_VERSION 213 # ifdef __cpp_lib_ranges 214 # error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!" 215 # endif 216 # endif 217 218 # ifndef __cpp_lib_raw_memory_algorithms 219 # error "__cpp_lib_raw_memory_algorithms should be defined in c++2a" 220 # endif 221 # if __cpp_lib_raw_memory_algorithms != 201606L 222 # error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++2a" 223 # endif 224 225 # if !defined(_LIBCPP_VERSION) 226 # ifndef __cpp_lib_shared_ptr_arrays 227 # error "__cpp_lib_shared_ptr_arrays should be defined in c++2a" 228 # endif 229 # if __cpp_lib_shared_ptr_arrays != 201611L 230 # error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++2a" 231 # endif 232 # else // _LIBCPP_VERSION 233 # ifdef __cpp_lib_shared_ptr_arrays 234 # error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!" 235 # endif 236 # endif 237 238 # ifndef __cpp_lib_shared_ptr_weak_type 239 # error "__cpp_lib_shared_ptr_weak_type should be defined in c++2a" 240 # endif 241 # if __cpp_lib_shared_ptr_weak_type != 201606L 242 # error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++2a" 243 # endif 244 245 #endif // TEST_STD_VER > 17 246 247 int main() {}