Debian Codegraph @

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