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 // <complex>
15 
16 // Test the feature test macros defined by <complex>
17 
18 /*  Constant                       Value
19     __cpp_lib_complex_udls         201309L [C++14]
20     __cpp_lib_constexpr_complex    201711L [C++20]
21 */
22 
23 #include <complex>
24 #include "test_macros.h"
25 
26 #if TEST_STD_VER < 14
27 
28 # ifdef __cpp_lib_complex_udls
29 #   error "__cpp_lib_complex_udls should not be defined before c++14"
30 # endif
31 
32 # ifdef __cpp_lib_constexpr_complex
33 #   error "__cpp_lib_constexpr_complex should not be defined before c++20"
34 # endif
35 
36 #elif TEST_STD_VER == 14
37 
38 # ifndef __cpp_lib_complex_udls
39 #   error "__cpp_lib_complex_udls should be defined in c++14"
40 # endif
41 # if __cpp_lib_complex_udls != 201309L
42 #   error "__cpp_lib_complex_udls should have the value 201309L in c++14"
43 # endif
44 
45 # ifdef __cpp_lib_constexpr_complex
46 #   error "__cpp_lib_constexpr_complex should not be defined before c++20"
47 # endif
48 
49 #elif TEST_STD_VER == 17
50 
51 # ifndef __cpp_lib_complex_udls
52 #   error "__cpp_lib_complex_udls should be defined in c++17"
53 # endif
54 # if __cpp_lib_complex_udls != 201309L
55 #   error "__cpp_lib_complex_udls should have the value 201309L in c++17"
56 # endif
57 
58 # ifdef __cpp_lib_constexpr_complex
59 #   error "__cpp_lib_constexpr_complex should not be defined before c++20"
60 # endif
61 
62 #elif TEST_STD_VER == 20
63 
64 # ifndef __cpp_lib_complex_udls
65 #   error "__cpp_lib_complex_udls should be defined in c++20"
66 # endif
67 # if __cpp_lib_complex_udls != 201309L
68 #   error "__cpp_lib_complex_udls should have the value 201309L in c++20"
69 # endif
70 
71 # if !defined(_LIBCPP_VERSION)
72 #   ifndef __cpp_lib_constexpr_complex
73 #     error "__cpp_lib_constexpr_complex should be defined in c++20"
74 #   endif
75 #   if __cpp_lib_constexpr_complex != 201711L
76 #     error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
77 #   endif
78 # else // _LIBCPP_VERSION
79 #   ifdef __cpp_lib_constexpr_complex
80 #     error "__cpp_lib_constexpr_complex should not be defined because it is unimplemented in libc++!"
81 #   endif
82 # endif
83 
84 #elif TEST_STD_VER > 20
85 
86 # ifndef __cpp_lib_complex_udls
87 #   error "__cpp_lib_complex_udls should be defined in c++2b"
88 # endif
89 # if __cpp_lib_complex_udls != 201309L
90 #   error "__cpp_lib_complex_udls should have the value 201309L in c++2b"
91 # endif
92 
93 # if !defined(_LIBCPP_VERSION)
94 #   ifndef __cpp_lib_constexpr_complex
95 #     error "__cpp_lib_constexpr_complex should be defined in c++2b"
96 #   endif
97 #   if __cpp_lib_constexpr_complex != 201711L
98 #     error "__cpp_lib_constexpr_complex should have the value 201711L in c++2b"
99 #   endif
100 # else // _LIBCPP_VERSION
101 #   ifdef __cpp_lib_constexpr_complex
102 #     error "__cpp_lib_constexpr_complex should not be defined because it is unimplemented in libc++!"
103 #   endif
104 # endif
105 
106 #endif // TEST_STD_VER > 20
107 
108