]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/std/version
libstdc++: Define std::__is_constant_evaluated() for internal use
[thirdparty/gcc.git] / libstdc++-v3 / include / std / version
CommitLineData
410fb7d7
JW
1// -*- C++ -*- Libstdc++ version details header.
2
99dee823 3// Copyright (C) 2018-2021 Free Software Foundation, Inc.
410fb7d7
JW
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file version
26 * This is a Standard C++ Library file. You should @c \#include this file
27 * in your programs, rather than any of the @a *.h implementation files.
28 */
29
30#ifndef _GLIBCXX_VERSION_INCLUDED
31#define _GLIBCXX_VERSION_INCLUDED
32
33#pragma GCC system_header
34
35#include <bits/c++config.h>
36
37// c++03
c6a7be9b
JW
38#if _GLIBCXX_HOSTED
39# define __cpp_lib_incomplete_container_elements 201505
40#endif
410fb7d7
JW
41
42#if !defined(__STRICT_ANSI__)
43// gnu++03
56a9eaf9 44# define __cpp_lib_uncaught_exceptions 201411L
410fb7d7
JW
45#endif
46
47#if __cplusplus >= 201103L
48// c++11
410fb7d7
JW
49#define __cpp_lib_is_null_pointer 201309
50#define __cpp_lib_result_of_sfinae 201210
c6a7be9b
JW
51
52#if _GLIBCXX_HOSTED
c6a7be9b
JW
53# define __cpp_lib_allocator_traits_is_always_equal 201411
54# define __cpp_lib_shared_ptr_arrays 201611L
55#endif
410fb7d7
JW
56
57#if !defined(__STRICT_ANSI__)
58// gnu++11
410fb7d7
JW
59# define __cpp_lib_is_swappable 201603
60# define __cpp_lib_void_t 201411
c6a7be9b
JW
61# if _GLIBCXX_HOSTED
62# define __cpp_lib_enable_shared_from_this 201603
63# endif
410fb7d7
JW
64#endif
65
66// For C++11 and later we support ISO/IEC 29124 Mathematical Special Functions
67#define __STDCPP_MATH_SPEC_FUNCS__ 201003L
68
69#if __cplusplus >= 201402L
70// c++14
dcf69ac5
IS
71#if __cpp_impl_coroutine
72# define __cpp_lib_coroutine 201902L
73#endif
410fb7d7
JW
74#define __cpp_lib_integral_constant_callable 201304
75#define __cpp_lib_is_final 201402L
410fb7d7 76#define __cpp_lib_transformation_trait_aliases 201304
c6a7be9b
JW
77
78#if _GLIBCXX_HOSTED
79# define __cpp_lib_chrono_udls 201304
80# define __cpp_lib_complex_udls 201309
81# define __cpp_lib_exchange_function 201304
82# define __cpp_lib_generic_associative_lookup 201304
83# define __cpp_lib_integer_sequence 201304
84# define __cpp_lib_make_reverse_iterator 201402
85# define __cpp_lib_make_unique 201304
86# ifndef _GLIBCXX_DEBUG // PR libstdc++/70303
87# define __cpp_lib_null_iterators 201304L
88# endif
89# define __cpp_lib_quoted_string_io 201304
90# define __cpp_lib_robust_nonmodifying_seq_ops 201304
91# ifdef _GLIBCXX_HAS_GTHREADS
f5d9bc8a 92# define __cpp_lib_shared_timed_mutex 201402L
c6a7be9b
JW
93# endif
94# define __cpp_lib_string_udls 201304
95# define __cpp_lib_transparent_operators 201510
96# define __cpp_lib_tuple_element_t 201402L
261d5a4a 97# define __cpp_lib_tuples_by_type 201304L
c6a7be9b 98#endif
410fb7d7
JW
99
100#if __cplusplus >= 201703L
101// c++17
102#define __cpp_lib_addressof_constexpr 201603
410fb7d7
JW
103#define __cpp_lib_atomic_is_always_lock_free 201603
104#define __cpp_lib_bool_constant 201505
410fb7d7 105#define __cpp_lib_byte 201603
ff273400
JW
106#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
107# define __cpp_lib_has_unique_object_representations 201606
108#endif
ff273400
JW
109#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
110# define __cpp_lib_is_aggregate 201703
111#endif
410fb7d7
JW
112#define __cpp_lib_is_invocable 201703
113#define __cpp_lib_is_swappable 201603
ff273400
JW
114#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
115# define __cpp_lib_launder 201606
116#endif
410fb7d7 117#define __cpp_lib_logical_traits 201510
c6a7be9b
JW
118#define __cpp_lib_type_trait_variable_templates 201510L
119#define __cpp_lib_uncaught_exceptions 201411L
120#define __cpp_lib_void_t 201411
121
122#if _GLIBCXX_HOSTED
123#define __cpp_lib_any 201606L
124#define __cpp_lib_apply 201603
f903c13c
JW
125#if __cplusplus == 201703L // N.B. updated value in C++20
126# define __cpp_lib_array_constexpr 201803L
127#endif
c6a7be9b
JW
128#define __cpp_lib_as_const 201510
129#define __cpp_lib_boyer_moore_searcher 201603
130#define __cpp_lib_chrono 201611
131#define __cpp_lib_clamp 201603
f903c13c 132#if __cplusplus == 201703L // N.B. updated value in C++20
74d14778 133# if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
b376b1ef
JW
134# define __cpp_lib_constexpr_char_traits 201611L
135# define __cpp_lib_constexpr_string 201611L
136# endif
f903c13c 137#endif
c6a7be9b 138#define __cpp_lib_enable_shared_from_this 201603
aac39307 139#define __cpp_lib_execution 201902L // FIXME: should be 201603L
c6a7be9b
JW
140#define __cpp_lib_filesystem 201703
141#define __cpp_lib_gcd 201606
142#define __cpp_lib_gcd_lcm 201606
76b75018
JM
143#ifdef __GCC_DESTRUCTIVE_SIZE
144# define __cpp_lib_hardware_interference_size 201703L
145#endif
c6a7be9b
JW
146#define __cpp_lib_hypot 201603
147#define __cpp_lib_invoke 201411L
148#define __cpp_lib_lcm 201606
410fb7d7 149#define __cpp_lib_make_from_tuple 201606
410fb7d7
JW
150#define __cpp_lib_map_try_emplace 201411
151#define __cpp_lib_math_special_functions 201603L
c5be6481 152#ifdef _GLIBCXX_HAS_GTHREADS
b1e7c6fc 153# define __cpp_lib_memory_resource 201603L
c5be6481
JW
154#else
155# define __cpp_lib_memory_resource 1
156#endif
410fb7d7
JW
157#define __cpp_lib_node_extract 201606
158#define __cpp_lib_nonmember_container_access 201411
159#define __cpp_lib_not_fn 201603
476f305b
JW
160#if __cplusplus == 201703L // N.B. updated value in C++20
161# define __cpp_lib_optional 201606L
162#endif
b8a28a06 163#define __cpp_lib_parallel_algorithm 201603L
56a9eaf9 164#define __cpp_lib_raw_memory_algorithms 201606L
410fb7d7 165#define __cpp_lib_sample 201603
ff273400
JW
166#ifdef _GLIBCXX_HAS_GTHREADS
167# define __cpp_lib_scoped_lock 201703
f5d9bc8a 168# define __cpp_lib_shared_mutex 201505L
ff273400 169#endif
410fb7d7 170#define __cpp_lib_shared_ptr_weak_type 201606
d0330a03 171#define __cpp_lib_string_view 201803L
f1a68574
JW
172#if _GLIBCXX_HAVE_USELOCALE
173# define __cpp_lib_to_chars 201611L
174#endif
410fb7d7 175#define __cpp_lib_unordered_map_try_emplace 201411
ad820b0b
JW
176#if __cplusplus == 201703L || ! __cpp_concepts // N.B. updated value in C++20
177# define __cpp_lib_variant 202102L
178#endif
c6a7be9b 179#endif
410fb7d7 180
f78f25f4 181#if __cplusplus >= 202002L
f004d6d9 182// c++20
491ba663 183#define __cpp_lib_atomic_flag_test 201907L
56772f62 184#define __cpp_lib_atomic_float 201711L
a90fe12c 185#define __cpp_lib_atomic_ref 201806L
e4379a93 186#define __cpp_lib_atomic_value_initialization 201911L
0d58d88d 187#define __cpp_lib_bitops 201907L
46610940 188#define __cpp_lib_bounded_array_traits 201902L
56772f62 189// __cpp_lib_char8_t is defined in <bits/c++config.h>
b8a28a06 190#if __cpp_concepts >= 201907L
c9313582 191# define __cpp_lib_concepts 202002L
cfc219ae 192#endif
329c0f89
JW
193#if __cpp_impl_destroying_delete
194# define __cpp_lib_destroying_delete 201806L
195#endif
a5378f9b 196#define __cpp_lib_endian 201907L
9866abe3 197#define __cpp_lib_int_pow2 202002L
74d14778 198#ifdef _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
134a6f7b
JJ
199# define __cpp_lib_is_constant_evaluated 201811L
200#endif
56772f62
JW
201#define __cpp_lib_is_nothrow_convertible 201806L
202#define __cpp_lib_remove_cvref 201711L
a2dcb56c
JW
203#if __cpp_impl_three_way_comparison >= 201907L && __cpp_lib_concepts
204# define __cpp_lib_three_way_comparison 201907L
205#endif
56772f62 206#define __cpp_lib_type_identity 201806L
bb54e0b8 207#define __cpp_lib_unwrap_ref 201811L
c6a7be9b
JW
208
209#if _GLIBCXX_HOSTED
e851aa17 210#define __cpp_lib_array_constexpr 201811L
56772f62 211#define __cpp_lib_assume_aligned 201811L
6591e422
TR
212#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
213# define __cpp_lib_atomic_wait 201907L
b7c3f201 214# if __cpp_aligned_new
194a9d67
JW
215# define __cpp_lib_barrier 201907L
216# endif
6591e422 217#endif
c6a7be9b 218#define __cpp_lib_bind_front 201907L
9e433b34
JW
219#if __has_builtin(__builtin_bit_cast)
220# define __cpp_lib_bit_cast 201806L
221#endif
aac39307 222// FIXME: #define __cpp_lib_execution 201902L
98cf2c26 223#define __cpp_lib_integer_comparison_functions 202002L
c6a7be9b 224#define __cpp_lib_constexpr_algorithms 201806L
b376b1ef
JW
225#ifdef __cpp_lib_is_constant_evaluated
226# define __cpp_lib_constexpr_char_traits 201811L
227#endif
393283b8 228#define __cpp_lib_constexpr_complex 201711L
c6a7be9b 229#define __cpp_lib_constexpr_dynamic_alloc 201907L
eca477d1 230#define __cpp_lib_constexpr_functional 201907L
b6ab9ecd 231#define __cpp_lib_constexpr_iterator 201811L
56772f62 232#define __cpp_lib_constexpr_memory 201811L
fd335985 233#define __cpp_lib_constexpr_numeric 201911L
b376b1ef 234#ifdef __cpp_lib_is_constant_evaluated
b96e2ff9
ML
235# if _GLIBCXX_USE_CXX11_ABI
236# define __cpp_lib_constexpr_string 201907L
237# else
238# define __cpp_lib_constexpr_string 201811L
239# endif
b376b1ef 240#endif
d0330a03
JW
241#define __cpp_lib_constexpr_string_view 201811L
242#define __cpp_lib_constexpr_tuple 201811L
243#define __cpp_lib_constexpr_utility 201811L
55b00d14 244#define __cpp_lib_erase_if 202002L
f78f25f4 245#define __cpp_lib_generic_unordered_lookup 201811L
c6a7be9b 246#define __cpp_lib_interpolate 201902L
e73ca078 247#ifdef _GLIBCXX_HAS_GTHREADS
aa12ab2e 248# define __cpp_lib_jthread 201911L
e73ca078 249#endif
037ef219
JW
250#if __has_builtin(__is_layout_compatible) \
251 && __has_builtin(__builtin_is_corresponding_member)
252# define __cpp_lib_is_layout_compatible 201907L
253#endif
4fa6c0ec
JW
254#if __has_builtin(__is_pointer_interconvertible_base_of) \
255 && __has_builtin(__builtin_is_pointer_interconvertible_with_class)
256# define __cpp_lib_is_pointer_interconvertible 201907L
257#endif
670f5095 258#if __cpp_lib_atomic_wait
71988274
JW
259# define __cpp_lib_latch 201907L
260#endif
afa07bdd 261#define __cpp_lib_list_remove_return_type 201806L
b1e7c6fc
JW
262#if __cpp_lib_concepts
263# define __cpp_lib_make_obj_using_allocator 201811L
264#endif
960b9ae0 265#define __cpp_lib_math_constants 201907L
476f305b 266#define __cpp_lib_optional 202106L
56772f62 267#define __cpp_lib_polymorphic_allocator 201902L
b8a28a06 268#if __cpp_lib_concepts
4b4f5666 269# define __cpp_lib_ranges 202106L
b8a28a06 270#endif
3215d4f5 271#if __cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE
183ae52b
JW
272# define __cpp_lib_semaphore 201907L
273#endif
56772f62 274#define __cpp_lib_shift 201806L
57d76ee9
JM
275#if __has_builtin(__builtin_source_location)
276# define __cpp_lib_source_location 201907L
277#endif
ecf65330
JW
278#if __cpp_lib_concepts
279# define __cpp_lib_span 202002L
280#endif
56772f62
JW
281#define __cpp_lib_ssize 201902L
282#define __cpp_lib_starts_ends_with 201711L
6bcbcea0 283# if _GLIBCXX_USE_CXX11_ABI
7244879b 284// Only supported with cxx11-abi
6bcbcea0
TR
285# define __cpp_lib_syncbuf 201803L
286# endif
56772f62 287#define __cpp_lib_to_address 201711L
cb0de9b6 288#define __cpp_lib_to_array 201907L
ad820b0b
JW
289#if __cpp_concepts
290# define __cpp_lib_variant 202106L
291#endif
c6a7be9b 292#endif
f004d6d9
PF
293
294#if __cplusplus > 202002L
295// c++2b
9e136807 296#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
7393fa8b 297#define __cpp_lib_byteswap 202110L
5b73abd1 298#define __cpp_lib_invoke_r 202106L
b8ecdc77 299#define __cpp_lib_is_scoped_enum 202011L
82b2e4f8
JW
300#if __cpp_lib_concepts
301# define __cpp_lib_monadic_optional 202110L
302#endif
881d1689 303#define __cpp_lib_move_only_function 202110L
a30a2e43
JW
304#if __cpp_lib_span
305# define __cpp_lib_spanstream 202106L
306#endif
f004d6d9 307#define __cpp_lib_string_contains 202011L
929abc7f
JW
308#if _GLIBCXX_USE_CXX11_ABI // Only supported with cxx11-abi
309# define __cpp_lib_string_resize_and_overwrite 202110L
310#endif
7244879b 311#define __cpp_lib_to_underlying 202102L
f004d6d9
PF
312#endif // C++2b
313#endif // C++20
410fb7d7
JW
314#endif // C++17
315#endif // C++14
316#endif // C++11
317
318#endif // _GLIBCXX_VERSION_INCLUDED