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 | // <span> |
13 | |
14 | // Test the feature test macros defined by <span> |
15 | |
16 | // clang-format off |
17 | |
18 | #include <span> |
19 | #include "test_macros.h" |
20 | |
21 | #if TEST_STD_VER < 14 |
22 | |
23 | # ifdef __cpp_lib_span |
24 | # error "__cpp_lib_span should not be defined before c++20" |
25 | # endif |
26 | |
27 | # ifdef __cpp_lib_span_at |
28 | # error "__cpp_lib_span_at should not be defined before c++26" |
29 | # endif |
30 | |
31 | # ifdef __cpp_lib_span_initializer_list |
32 | # error "__cpp_lib_span_initializer_list should not be defined before c++26" |
33 | # endif |
34 | |
35 | #elif TEST_STD_VER == 14 |
36 | |
37 | # ifdef __cpp_lib_span |
38 | # error "__cpp_lib_span should not be defined before c++20" |
39 | # endif |
40 | |
41 | # ifdef __cpp_lib_span_at |
42 | # error "__cpp_lib_span_at should not be defined before c++26" |
43 | # endif |
44 | |
45 | # ifdef __cpp_lib_span_initializer_list |
46 | # error "__cpp_lib_span_initializer_list should not be defined before c++26" |
47 | # endif |
48 | |
49 | #elif TEST_STD_VER == 17 |
50 | |
51 | # ifdef __cpp_lib_span |
52 | # error "__cpp_lib_span should not be defined before c++20" |
53 | # endif |
54 | |
55 | # ifdef __cpp_lib_span_at |
56 | # error "__cpp_lib_span_at should not be defined before c++26" |
57 | # endif |
58 | |
59 | # ifdef __cpp_lib_span_initializer_list |
60 | # error "__cpp_lib_span_initializer_list should not be defined before c++26" |
61 | # endif |
62 | |
63 | #elif TEST_STD_VER == 20 |
64 | |
65 | # ifndef __cpp_lib_span |
66 | # error "__cpp_lib_span should be defined in c++20" |
67 | # endif |
68 | # if __cpp_lib_span != 202002L |
69 | # error "__cpp_lib_span should have the value 202002L in c++20" |
70 | # endif |
71 | |
72 | # ifdef __cpp_lib_span_at |
73 | # error "__cpp_lib_span_at should not be defined before c++26" |
74 | # endif |
75 | |
76 | # ifdef __cpp_lib_span_initializer_list |
77 | # error "__cpp_lib_span_initializer_list should not be defined before c++26" |
78 | # endif |
79 | |
80 | #elif TEST_STD_VER == 23 |
81 | |
82 | # ifndef __cpp_lib_span |
83 | # error "__cpp_lib_span should be defined in c++23" |
84 | # endif |
85 | # if __cpp_lib_span != 202002L |
86 | # error "__cpp_lib_span should have the value 202002L in c++23" |
87 | # endif |
88 | |
89 | # ifdef __cpp_lib_span_at |
90 | # error "__cpp_lib_span_at should not be defined before c++26" |
91 | # endif |
92 | |
93 | # ifdef __cpp_lib_span_initializer_list |
94 | # error "__cpp_lib_span_initializer_list should not be defined before c++26" |
95 | # endif |
96 | |
97 | #elif TEST_STD_VER > 23 |
98 | |
99 | # ifndef __cpp_lib_span |
100 | # error "__cpp_lib_span should be defined in c++26" |
101 | # endif |
102 | # if __cpp_lib_span != 202002L |
103 | # error "__cpp_lib_span should have the value 202002L in c++26" |
104 | # endif |
105 | |
106 | # ifndef __cpp_lib_span_at |
107 | # error "__cpp_lib_span_at should be defined in c++26" |
108 | # endif |
109 | # if __cpp_lib_span_at != 202311L |
110 | # error "__cpp_lib_span_at should have the value 202311L in c++26" |
111 | # endif |
112 | |
113 | # ifndef __cpp_lib_span_initializer_list |
114 | # error "__cpp_lib_span_initializer_list should be defined in c++26" |
115 | # endif |
116 | # if __cpp_lib_span_initializer_list != 202311L |
117 | # error "__cpp_lib_span_initializer_list should have the value 202311L in c++26" |
118 | # endif |
119 | |
120 | #endif // TEST_STD_VER > 23 |
121 | |
122 | // clang-format on |
123 | |
124 | |