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

source code of libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp