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