1
2 //===----------------------------------------------------------------------===//
3 //
4 // The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 //
11 // <version> feature macros
12
13 /* Constant Value
14 __cpp_lib_addressof_constexpr 201603L
15 __cpp_lib_allocator_traits_is_always_equal 201411L
16 __cpp_lib_any 201606L
17 __cpp_lib_apply 201603L
18 __cpp_lib_array_constexpr 201603L
19 __cpp_lib_as_const 201510L
20 __cpp_lib_atomic_is_always_lock_free 201603L
21 __cpp_lib_atomic_ref 201806L
22 __cpp_lib_bit_cast 201806L
23 __cpp_lib_bool_constant 201505L
24 __cpp_lib_boyer_moore_searcher 201603L
25 __cpp_lib_byte 201603L
26 __cpp_lib_chrono 201611L
27 __cpp_lib_chrono_udls 201304L
28 __cpp_lib_clamp 201603L
29 __cpp_lib_complex_udls 201309L
30 __cpp_lib_concepts 201806L
31 __cpp_lib_constexpr_swap_algorithms 201806L
32 __cpp_lib_destroying_delete 201806L
33 __cpp_lib_enable_shared_from_this 201603L
34 __cpp_lib_exchange_function 201304L
35 __cpp_lib_execution 201603L
36 __cpp_lib_filesystem 201703L
37 __cpp_lib_gcd_lcm 201606L
38 __cpp_lib_generic_associative_lookup 201304L
39 __cpp_lib_hardware_interference_size 201703L
40 __cpp_lib_has_unique_object_representations 201606L
41 __cpp_lib_hypot 201603L
42 __cpp_lib_incomplete_container_elements 201505L
43 __cpp_lib_integer_sequence 201304L
44 __cpp_lib_integral_constant_callable 201304L
45 __cpp_lib_invoke 201411L
46 __cpp_lib_is_aggregate 201703L
47 __cpp_lib_is_final 201402L
48 __cpp_lib_is_invocable 201703L
49 __cpp_lib_is_null_pointer 201309L
50 __cpp_lib_is_swappable 201603L
51 __cpp_lib_launder 201606L
52 __cpp_lib_list_remove_return_type 201806L
53 __cpp_lib_logical_traits 201510L
54 __cpp_lib_make_from_tuple 201606L
55 __cpp_lib_make_reverse_iterator 201402L
56 __cpp_lib_make_unique 201304L
57 __cpp_lib_map_try_emplace 201411L
58 __cpp_lib_math_special_functions 201603L
59 __cpp_lib_memory_resource 201603L
60 __cpp_lib_node_extract 201606L
61 __cpp_lib_nonmember_container_access 201411L
62 __cpp_lib_not_fn 201603L
63 __cpp_lib_null_iterators 201304L
64 __cpp_lib_optional 201606L
65 __cpp_lib_parallel_algorithm 201603L
66 __cpp_lib_quoted_string_io 201304L
67 __cpp_lib_raw_memory_algorithms 201606L
68 __cpp_lib_result_of_sfinae 201210L
69 __cpp_lib_robust_nonmodifying_seq_ops 201304L
70 __cpp_lib_sample 201603L
71 __cpp_lib_scoped_lock 201703L
72 __cpp_lib_shared_mutex 201505L
73 __cpp_lib_shared_ptr_arrays 201611L
74 __cpp_lib_shared_ptr_weak_type 201606L
75 __cpp_lib_shared_timed_mutex 201402L
76 __cpp_lib_string_udls 201304L
77 __cpp_lib_string_view 201606L
78 __cpp_lib_to_chars 201611L
79 __cpp_lib_three_way_comparison 201711L
80 __cpp_lib_transformation_trait_aliases 201304L
81 __cpp_lib_transparent_operators 201510L
82 __cpp_lib_tuple_element_t 201402L
83 __cpp_lib_tuples_by_type 201304L
84 __cpp_lib_type_trait_variable_templates 201510L
85 __cpp_lib_uncaught_exceptions 201411L
86 __cpp_lib_unordered_map_try_emplace 201411L
87 __cpp_lib_variant 201606L
88 __cpp_lib_void_t 201411L
89
90 */
91
92 #include <version>
93 #include <cassert>
94 #include "test_macros.h"
95
main()96 int main()
97 {
98 // ensure that the macros that are supposed to be defined in <version> are defined.
99
100 #if TEST_STD_VER > 14
101 # if !defined(__cpp_lib_atomic_is_always_lock_free)
102 # error "__cpp_lib_atomic_is_always_lock_free is not defined"
103 # elif __cpp_lib_atomic_is_always_lock_free < 201603L
104 # error "__cpp_lib_atomic_is_always_lock_free has an invalid value"
105 # endif
106 #endif
107
108 #if TEST_STD_VER > 14
109 # if !defined(__cpp_lib_filesystem)
110 # error "__cpp_lib_filesystem is not defined"
111 # elif __cpp_lib_filesystem < 201703L
112 # error "__cpp_lib_filesystem has an invalid value"
113 # endif
114 #endif
115
116 #if TEST_STD_VER > 14
117 # if !defined(__cpp_lib_invoke)
118 # error "__cpp_lib_invoke is not defined"
119 # elif __cpp_lib_invoke < 201411L
120 # error "__cpp_lib_invoke has an invalid value"
121 # endif
122 #endif
123
124 #if TEST_STD_VER > 14
125 # if !defined(__cpp_lib_void_t)
126 # error "__cpp_lib_void_t is not defined"
127 # elif __cpp_lib_void_t < 201411L
128 # error "__cpp_lib_void_t has an invalid value"
129 # endif
130 #endif
131
132 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
133 # if !defined(__cpp_lib_char8_t)
134 LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
135 # else
136 # if __cpp_lib_char8_t < 201811L
137 # error "__cpp_lib_char8_t has an invalid value"
138 # endif
139 # endif
140 #endif
141
142 /*
143 #if !defined(__cpp_lib_fooby)
144 # error "__cpp_lib_fooby is not defined"
145 #elif __cpp_lib_fooby < 201606L
146 # error "__cpp_lib_fooby has an invalid value"
147 #endif
148 */
149 }
150