1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // WARNING: This test was generated by generate_feature_test_macro_components.py
11 // and should not be edited manually.
15 // Test the feature test macros defined by <utility>
18 __cpp_lib_as_const 201510L [C++17]
19 __cpp_lib_constexpr_misc 201811L [C++2a]
20 __cpp_lib_exchange_function 201304L [C++14]
21 __cpp_lib_integer_sequence 201304L [C++14]
22 __cpp_lib_to_chars 201611L [C++17]
23 __cpp_lib_tuples_by_type 201304L [C++14]
27 #include "test_macros.h"
31 # ifdef __cpp_lib_as_const
32 # error "__cpp_lib_as_const should not be defined before c++17"
35 # ifdef __cpp_lib_constexpr_misc
36 # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
39 # ifdef __cpp_lib_exchange_function
40 # error "__cpp_lib_exchange_function should not be defined before c++14"
43 # ifdef __cpp_lib_integer_sequence
44 # error "__cpp_lib_integer_sequence should not be defined before c++14"
47 # ifdef __cpp_lib_to_chars
48 # error "__cpp_lib_to_chars should not be defined before c++17"
51 # ifdef __cpp_lib_tuples_by_type
52 # error "__cpp_lib_tuples_by_type should not be defined before c++14"
55 #elif TEST_STD_VER == 14
57 # ifdef __cpp_lib_as_const
58 # error "__cpp_lib_as_const should not be defined before c++17"
61 # ifdef __cpp_lib_constexpr_misc
62 # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
65 # ifndef __cpp_lib_exchange_function
66 # error "__cpp_lib_exchange_function should be defined in c++14"
68 # if __cpp_lib_exchange_function != 201304L
69 # error "__cpp_lib_exchange_function should have the value 201304L in c++14"
72 # ifndef __cpp_lib_integer_sequence
73 # error "__cpp_lib_integer_sequence should be defined in c++14"
75 # if __cpp_lib_integer_sequence != 201304L
76 # error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
79 # ifdef __cpp_lib_to_chars
80 # error "__cpp_lib_to_chars should not be defined before c++17"
83 # ifndef __cpp_lib_tuples_by_type
84 # error "__cpp_lib_tuples_by_type should be defined in c++14"
86 # if __cpp_lib_tuples_by_type != 201304L
87 # error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
90 #elif TEST_STD_VER == 17
92 # ifndef __cpp_lib_as_const
93 # error "__cpp_lib_as_const should be defined in c++17"
95 # if __cpp_lib_as_const != 201510L
96 # error "__cpp_lib_as_const should have the value 201510L in c++17"
99 # ifdef __cpp_lib_constexpr_misc
100 # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
103 # ifndef __cpp_lib_exchange_function
104 # error "__cpp_lib_exchange_function should be defined in c++17"
106 # if __cpp_lib_exchange_function != 201304L
107 # error "__cpp_lib_exchange_function should have the value 201304L in c++17"
110 # ifndef __cpp_lib_integer_sequence
111 # error "__cpp_lib_integer_sequence should be defined in c++17"
113 # if __cpp_lib_integer_sequence != 201304L
114 # error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
117 # if !defined(_LIBCPP_VERSION)
118 # ifndef __cpp_lib_to_chars
119 # error "__cpp_lib_to_chars should be defined in c++17"
121 # if __cpp_lib_to_chars != 201611L
122 # error "__cpp_lib_to_chars should have the value 201611L in c++17"
124 # else // _LIBCPP_VERSION
125 # ifdef __cpp_lib_to_chars
126 # error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
130 # ifndef __cpp_lib_tuples_by_type
131 # error "__cpp_lib_tuples_by_type should be defined in c++17"
133 # if __cpp_lib_tuples_by_type != 201304L
134 # error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
137 #elif TEST_STD_VER > 17
139 # ifndef __cpp_lib_as_const
140 # error "__cpp_lib_as_const should be defined in c++2a"
142 # if __cpp_lib_as_const != 201510L
143 # error "__cpp_lib_as_const should have the value 201510L in c++2a"
146 # if !defined(_LIBCPP_VERSION)
147 # ifndef __cpp_lib_constexpr_misc
148 # error "__cpp_lib_constexpr_misc should be defined in c++2a"
150 # if __cpp_lib_constexpr_misc != 201811L
151 # error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a"
153 # else // _LIBCPP_VERSION
154 # ifdef __cpp_lib_constexpr_misc
155 # error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!"
159 # ifndef __cpp_lib_exchange_function
160 # error "__cpp_lib_exchange_function should be defined in c++2a"
162 # if __cpp_lib_exchange_function != 201304L
163 # error "__cpp_lib_exchange_function should have the value 201304L in c++2a"
166 # ifndef __cpp_lib_integer_sequence
167 # error "__cpp_lib_integer_sequence should be defined in c++2a"
169 # if __cpp_lib_integer_sequence != 201304L
170 # error "__cpp_lib_integer_sequence should have the value 201304L in c++2a"
173 # if !defined(_LIBCPP_VERSION)
174 # ifndef __cpp_lib_to_chars
175 # error "__cpp_lib_to_chars should be defined in c++2a"
177 # if __cpp_lib_to_chars != 201611L
178 # error "__cpp_lib_to_chars should have the value 201611L in c++2a"
180 # else // _LIBCPP_VERSION
181 # ifdef __cpp_lib_to_chars
182 # error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
186 # ifndef __cpp_lib_tuples_by_type
187 # error "__cpp_lib_tuples_by_type should be defined in c++2a"
189 # if __cpp_lib_tuples_by_type != 201304L
190 # error "__cpp_lib_tuples_by_type should have the value 201304L in c++2a"
193 #endif // TEST_STD_VER > 17