Debian Codegraph @

libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp

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