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 // <charconv>
15 
16 // Test the feature test macros defined by <charconv>
17 
18 /*  Constant              Value
19     __cpp_lib_to_chars    201611L [C++17]
20 */
21 
22 #include <charconv>
23 #include "test_macros.h"
24 
25 #if TEST_STD_VER < 14
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_to_chars
34 #   error "__cpp_lib_to_chars should not be defined before c++17"
35 # endif
36 
37 #elif TEST_STD_VER == 17
38 
39 # if !defined(_LIBCPP_VERSION)
40 #   ifndef __cpp_lib_to_chars
41 #     error "__cpp_lib_to_chars should be defined in c++17"
42 #   endif
43 #   if __cpp_lib_to_chars != 201611L
44 #     error "__cpp_lib_to_chars should have the value 201611L in c++17"
45 #   endif
46 # else // _LIBCPP_VERSION
47 #   ifdef __cpp_lib_to_chars
48 #     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
49 #   endif
50 # endif
51 
52 #elif TEST_STD_VER == 20
53 
54 # if !defined(_LIBCPP_VERSION)
55 #   ifndef __cpp_lib_to_chars
56 #     error "__cpp_lib_to_chars should be defined in c++20"
57 #   endif
58 #   if __cpp_lib_to_chars != 201611L
59 #     error "__cpp_lib_to_chars should have the value 201611L in c++20"
60 #   endif
61 # else // _LIBCPP_VERSION
62 #   ifdef __cpp_lib_to_chars
63 #     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
64 #   endif
65 # endif
66 
67 #elif TEST_STD_VER > 20
68 
69 # if !defined(_LIBCPP_VERSION)
70 #   ifndef __cpp_lib_to_chars
71 #     error "__cpp_lib_to_chars should be defined in c++2b"
72 #   endif
73 #   if __cpp_lib_to_chars != 201611L
74 #     error "__cpp_lib_to_chars should have the value 201611L in c++2b"
75 #   endif
76 # else // _LIBCPP_VERSION
77 #   ifdef __cpp_lib_to_chars
78 #     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
79 #   endif
80 # endif
81 
82 #endif // TEST_STD_VER > 20
83 
84