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 // <mdspan> 15 16 // Test the feature test macros defined by <mdspan> 17 18 /* Constant Value 19 __cpp_lib_freestanding_mdspan 202311L [C++26] 20 __cpp_lib_mdspan 202207L [C++23] 21 202406L [C++26] 22 __cpp_lib_submdspan 202306L [C++26] 23 */ 24 25 #include <mdspan> 26 #include "test_macros.h" 27 28 #if TEST_STD_VER < 14 29 30 # ifdef __cpp_lib_freestanding_mdspan 31 # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" 32 # endif 33 34 # ifdef __cpp_lib_mdspan 35 # error "__cpp_lib_mdspan should not be defined before c++23" 36 # endif 37 38 # ifdef __cpp_lib_submdspan 39 # error "__cpp_lib_submdspan should not be defined before c++26" 40 # endif 41 42 #elif TEST_STD_VER == 14 43 44 # ifdef __cpp_lib_freestanding_mdspan 45 # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" 46 # endif 47 48 # ifdef __cpp_lib_mdspan 49 # error "__cpp_lib_mdspan should not be defined before c++23" 50 # endif 51 52 # ifdef __cpp_lib_submdspan 53 # error "__cpp_lib_submdspan should not be defined before c++26" 54 # endif 55 56 #elif TEST_STD_VER == 17 57 58 # ifdef __cpp_lib_freestanding_mdspan 59 # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" 60 # endif 61 62 # ifdef __cpp_lib_mdspan 63 # error "__cpp_lib_mdspan should not be defined before c++23" 64 # endif 65 66 # ifdef __cpp_lib_submdspan 67 # error "__cpp_lib_submdspan should not be defined before c++26" 68 # endif 69 70 #elif TEST_STD_VER == 20 71 72 # ifdef __cpp_lib_freestanding_mdspan 73 # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" 74 # endif 75 76 # ifdef __cpp_lib_mdspan 77 # error "__cpp_lib_mdspan should not be defined before c++23" 78 # endif 79 80 # ifdef __cpp_lib_submdspan 81 # error "__cpp_lib_submdspan should not be defined before c++26" 82 # endif 83 84 #elif TEST_STD_VER == 23 85 86 # ifdef __cpp_lib_freestanding_mdspan 87 # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" 88 # endif 89 90 # ifndef __cpp_lib_mdspan 91 # error "__cpp_lib_mdspan should be defined in c++23" 92 # endif 93 # if __cpp_lib_mdspan != 202207L 94 # error "__cpp_lib_mdspan should have the value 202207L in c++23" 95 # endif 96 97 # ifdef __cpp_lib_submdspan 98 # error "__cpp_lib_submdspan should not be defined before c++26" 99 # endif 100 101 #elif TEST_STD_VER > 23 102 103 # if !defined(_LIBCPP_VERSION) 104 # ifndef __cpp_lib_freestanding_mdspan 105 # error "__cpp_lib_freestanding_mdspan should be defined in c++26" 106 # endif 107 # if __cpp_lib_freestanding_mdspan != 202311L 108 # error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26" 109 # endif 110 # else // _LIBCPP_VERSION 111 # ifdef __cpp_lib_freestanding_mdspan 112 # error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!" 113 # endif 114 # endif 115 116 # ifndef __cpp_lib_mdspan 117 # error "__cpp_lib_mdspan should be defined in c++26" 118 # endif 119 # if __cpp_lib_mdspan != 202406L 120 # error "__cpp_lib_mdspan should have the value 202406L in c++26" 121 # endif 122 123 # if !defined(_LIBCPP_VERSION) 124 # ifndef __cpp_lib_submdspan 125 # error "__cpp_lib_submdspan should be defined in c++26" 126 # endif 127 # if __cpp_lib_submdspan != 202306L 128 # error "__cpp_lib_submdspan should have the value 202306L in c++26" 129 # endif 130 # else // _LIBCPP_VERSION 131 # ifdef __cpp_lib_submdspan 132 # error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!" 133 # endif 134 # endif 135 136 #endif // TEST_STD_VER > 23 137 138