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 // <deque>
15 
16 // Test the feature test macros defined by <deque>
17 
18 /*  Constant                                      Value
19     __cpp_lib_allocator_traits_is_always_equal    201411L [C++17]
20     __cpp_lib_erase_if                            202002L [C++20]
21     __cpp_lib_nonmember_container_access          201411L [C++17]
22     __cpp_lib_ranges_to_container                 202202L [C++2b]
23 */
24 
25 #include <deque>
26 #include "test_macros.h"
27 
28 #if TEST_STD_VER < 14
29 
30 # ifdef __cpp_lib_allocator_traits_is_always_equal
31 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
32 # endif
33 
34 # ifdef __cpp_lib_erase_if
35 #   error "__cpp_lib_erase_if should not be defined before c++20"
36 # endif
37 
38 # ifdef __cpp_lib_nonmember_container_access
39 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
40 # endif
41 
42 # ifdef __cpp_lib_ranges_to_container
43 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
44 # endif
45 
46 #elif TEST_STD_VER == 14
47 
48 # ifdef __cpp_lib_allocator_traits_is_always_equal
49 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
50 # endif
51 
52 # ifdef __cpp_lib_erase_if
53 #   error "__cpp_lib_erase_if should not be defined before c++20"
54 # endif
55 
56 # ifdef __cpp_lib_nonmember_container_access
57 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
58 # endif
59 
60 # ifdef __cpp_lib_ranges_to_container
61 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
62 # endif
63 
64 #elif TEST_STD_VER == 17
65 
66 # ifndef __cpp_lib_allocator_traits_is_always_equal
67 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
68 # endif
69 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
70 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
71 # endif
72 
73 # ifdef __cpp_lib_erase_if
74 #   error "__cpp_lib_erase_if should not be defined before c++20"
75 # endif
76 
77 # ifndef __cpp_lib_nonmember_container_access
78 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
79 # endif
80 # if __cpp_lib_nonmember_container_access != 201411L
81 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
82 # endif
83 
84 # ifdef __cpp_lib_ranges_to_container
85 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
86 # endif
87 
88 #elif TEST_STD_VER == 20
89 
90 # ifndef __cpp_lib_allocator_traits_is_always_equal
91 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
92 # endif
93 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
94 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
95 # endif
96 
97 # ifndef __cpp_lib_erase_if
98 #   error "__cpp_lib_erase_if should be defined in c++20"
99 # endif
100 # if __cpp_lib_erase_if != 202002L
101 #   error "__cpp_lib_erase_if should have the value 202002L in c++20"
102 # endif
103 
104 # ifndef __cpp_lib_nonmember_container_access
105 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
106 # endif
107 # if __cpp_lib_nonmember_container_access != 201411L
108 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
109 # endif
110 
111 # ifdef __cpp_lib_ranges_to_container
112 #   error "__cpp_lib_ranges_to_container should not be defined before c++2b"
113 # endif
114 
115 #elif TEST_STD_VER > 20
116 
117 # ifndef __cpp_lib_allocator_traits_is_always_equal
118 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2b"
119 # endif
120 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
121 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2b"
122 # endif
123 
124 # ifndef __cpp_lib_erase_if
125 #   error "__cpp_lib_erase_if should be defined in c++2b"
126 # endif
127 # if __cpp_lib_erase_if != 202002L
128 #   error "__cpp_lib_erase_if should have the value 202002L in c++2b"
129 # endif
130 
131 # ifndef __cpp_lib_nonmember_container_access
132 #   error "__cpp_lib_nonmember_container_access should be defined in c++2b"
133 # endif
134 # if __cpp_lib_nonmember_container_access != 201411L
135 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2b"
136 # endif
137 
138 # if !defined(_LIBCPP_VERSION)
139 #   ifndef __cpp_lib_ranges_to_container
140 #     error "__cpp_lib_ranges_to_container should be defined in c++2b"
141 #   endif
142 #   if __cpp_lib_ranges_to_container != 202202L
143 #     error "__cpp_lib_ranges_to_container should have the value 202202L in c++2b"
144 #   endif
145 # else // _LIBCPP_VERSION
146 #   ifdef __cpp_lib_ranges_to_container
147 #     error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!"
148 #   endif
149 # endif
150 
151 #endif // TEST_STD_VER > 20
152 
153