Skip to content

Commit 00e3607

Browse files
feature test macros
1 parent 28f98a8 commit 00e3607

File tree

6 files changed

+102
-37
lines changed

6 files changed

+102
-37
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Status
202202
---------------------------------------------------------- -----------------
203203
``__cpp_lib_constexpr_algorithms`` ``201806L``
204204
---------------------------------------------------------- -----------------
205-
``__cpp_lib_constexpr_complex`` ``201711L``
205+
``__cpp_lib_constexpr_deque`` ``202502L``
206206
---------------------------------------------------------- -----------------
207207
``__cpp_lib_constexpr_dynamic_alloc`` ``201907L``
208208
---------------------------------------------------------- -----------------
@@ -416,6 +416,8 @@ Status
416416
---------------------------------------------------------- -----------------
417417
``__cpp_lib_bitset`` ``202306L``
418418
---------------------------------------------------------- -----------------
419+
``__cpp_lib_constexpr_complex`` ``201711L``
420+
---------------------------------------------------------- -----------------
419421
``__cpp_lib_constexpr_new`` ``202406L``
420422
---------------------------------------------------------- -----------------
421423
``__cpp_lib_constrained_equality`` *unimplemented*

libcxx/include/version

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ __cpp_lib_constexpr_algorithms 201806L <algorithm> <uti
6464
__cpp_lib_constexpr_bitset 202207L <bitset>
6565
__cpp_lib_constexpr_charconv 202207L <charconv>
6666
__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>
67-
__cpp_lib_constexpr_complex 201711L <complex>
67+
__cpp_lib_constexpr_complex 201711L <deque>
68+
__cpp_lib_constexpr_deque 202502L <complex>
6869
__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
6970
__cpp_lib_constexpr_functional 201907L <functional>
7071
__cpp_lib_constexpr_iterator 201811L <iterator>
@@ -398,7 +399,7 @@ __cpp_lib_void_t 201411L <type_traits>
398399
# endif
399400
# define __cpp_lib_concepts 202002L
400401
# define __cpp_lib_constexpr_algorithms 201806L
401-
# define __cpp_lib_constexpr_complex 201711L
402+
# define __cpp_lib_constexpr_deque 202502L
402403
# define __cpp_lib_constexpr_dynamic_alloc 201907L
403404
# define __cpp_lib_constexpr_functional 201907L
404405
# define __cpp_lib_constexpr_iterator 201811L
@@ -536,6 +537,7 @@ __cpp_lib_void_t 201411L <type_traits>
536537
# undef __cpp_lib_bind_front
537538
# define __cpp_lib_bind_front 202306L
538539
# define __cpp_lib_bitset 202306L
540+
# define __cpp_lib_constexpr_complex 201711L
539541
# if !defined(_LIBCPP_ABI_VCRUNTIME)
540542
# define __cpp_lib_constexpr_new 202406L
541543
# endif

libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
// Test the feature test macros defined by <complex>
1717

18-
/* Constant Value
19-
__cpp_lib_complex_udls 201309L [C++14]
20-
__cpp_lib_constexpr_complex 201711L [C++20]
18+
/* Constant Value
19+
__cpp_lib_complex_udls 201309L [C++14]
20+
__cpp_lib_constexpr_deque 202502L [C++20]
2121
*/
2222

2323
#include <complex>
@@ -29,8 +29,8 @@
2929
# error "__cpp_lib_complex_udls should not be defined before c++14"
3030
# endif
3131

32-
# ifdef __cpp_lib_constexpr_complex
33-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
32+
# ifdef __cpp_lib_constexpr_deque
33+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
3434
# endif
3535

3636
#elif TEST_STD_VER == 14
@@ -42,8 +42,8 @@
4242
# error "__cpp_lib_complex_udls should have the value 201309L in c++14"
4343
# endif
4444

45-
# ifdef __cpp_lib_constexpr_complex
46-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
45+
# ifdef __cpp_lib_constexpr_deque
46+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
4747
# endif
4848

4949
#elif TEST_STD_VER == 17
@@ -55,8 +55,8 @@
5555
# error "__cpp_lib_complex_udls should have the value 201309L in c++17"
5656
# endif
5757

58-
# ifdef __cpp_lib_constexpr_complex
59-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
58+
# ifdef __cpp_lib_constexpr_deque
59+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
6060
# endif
6161

6262
#elif TEST_STD_VER == 20
@@ -68,11 +68,11 @@
6868
# error "__cpp_lib_complex_udls should have the value 201309L in c++20"
6969
# endif
7070

71-
# ifndef __cpp_lib_constexpr_complex
72-
# error "__cpp_lib_constexpr_complex should be defined in c++20"
71+
# ifndef __cpp_lib_constexpr_deque
72+
# error "__cpp_lib_constexpr_deque should be defined in c++20"
7373
# endif
74-
# if __cpp_lib_constexpr_complex != 201711L
75-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
74+
# if __cpp_lib_constexpr_deque != 202502L
75+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
7676
# endif
7777

7878
#elif TEST_STD_VER == 23
@@ -84,11 +84,11 @@
8484
# error "__cpp_lib_complex_udls should have the value 201309L in c++23"
8585
# endif
8686

87-
# ifndef __cpp_lib_constexpr_complex
88-
# error "__cpp_lib_constexpr_complex should be defined in c++23"
87+
# ifndef __cpp_lib_constexpr_deque
88+
# error "__cpp_lib_constexpr_deque should be defined in c++23"
8989
# endif
90-
# if __cpp_lib_constexpr_complex != 201711L
91-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
90+
# if __cpp_lib_constexpr_deque != 202502L
91+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
9292
# endif
9393

9494
#elif TEST_STD_VER > 23
@@ -100,11 +100,11 @@
100100
# error "__cpp_lib_complex_udls should have the value 201309L in c++26"
101101
# endif
102102

103-
# ifndef __cpp_lib_constexpr_complex
104-
# error "__cpp_lib_constexpr_complex should be defined in c++26"
103+
# ifndef __cpp_lib_constexpr_deque
104+
# error "__cpp_lib_constexpr_deque should be defined in c++26"
105105
# endif
106-
# if __cpp_lib_constexpr_complex != 201711L
107-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
106+
# if __cpp_lib_constexpr_deque != 202502L
107+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26"
108108
# endif
109109

110110
#endif // TEST_STD_VER > 23

libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/* Constant Value
1919
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
20+
__cpp_lib_constexpr_complex 201711L [C++26]
2021
__cpp_lib_containers_ranges 202202L [C++23]
2122
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
2223
__cpp_lib_erase_if 202002L [C++20]
@@ -32,6 +33,10 @@
3233
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
3334
# endif
3435

36+
# ifdef __cpp_lib_constexpr_complex
37+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
38+
# endif
39+
3540
# ifdef __cpp_lib_containers_ranges
3641
# error "__cpp_lib_containers_ranges should not be defined before c++23"
3742
# endif
@@ -54,6 +59,10 @@
5459
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
5560
# endif
5661

62+
# ifdef __cpp_lib_constexpr_complex
63+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
64+
# endif
65+
5766
# ifdef __cpp_lib_containers_ranges
5867
# error "__cpp_lib_containers_ranges should not be defined before c++23"
5968
# endif
@@ -79,6 +88,10 @@
7988
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
8089
# endif
8190

91+
# ifdef __cpp_lib_constexpr_complex
92+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
93+
# endif
94+
8295
# ifdef __cpp_lib_containers_ranges
8396
# error "__cpp_lib_containers_ranges should not be defined before c++23"
8497
# endif
@@ -107,6 +120,10 @@
107120
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
108121
# endif
109122

123+
# ifdef __cpp_lib_constexpr_complex
124+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
125+
# endif
126+
110127
# ifdef __cpp_lib_containers_ranges
111128
# error "__cpp_lib_containers_ranges should not be defined before c++23"
112129
# endif
@@ -138,6 +155,10 @@
138155
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
139156
# endif
140157

158+
# ifdef __cpp_lib_constexpr_complex
159+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
160+
# endif
161+
141162
# ifndef __cpp_lib_containers_ranges
142163
# error "__cpp_lib_containers_ranges should be defined in c++23"
143164
# endif
@@ -172,6 +193,13 @@
172193
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
173194
# endif
174195

196+
# ifndef __cpp_lib_constexpr_complex
197+
# error "__cpp_lib_constexpr_complex should be defined in c++26"
198+
# endif
199+
# if __cpp_lib_constexpr_complex != 201711L
200+
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
201+
# endif
202+
175203
# ifndef __cpp_lib_containers_ranges
176204
# error "__cpp_lib_containers_ranges should be defined in c++26"
177205
# endif

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
__cpp_lib_constexpr_bitset 202207L [C++23]
6060
__cpp_lib_constexpr_charconv 202207L [C++23]
6161
__cpp_lib_constexpr_cmath 202202L [C++23]
62-
__cpp_lib_constexpr_complex 201711L [C++20]
62+
__cpp_lib_constexpr_complex 201711L [C++26]
63+
__cpp_lib_constexpr_deque 202502L [C++20]
6364
__cpp_lib_constexpr_dynamic_alloc 201907L [C++20]
6465
__cpp_lib_constexpr_functional 201907L [C++20]
6566
__cpp_lib_constexpr_iterator 201811L [C++20]
@@ -423,7 +424,11 @@
423424
# endif
424425

425426
# ifdef __cpp_lib_constexpr_complex
426-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
427+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
428+
# endif
429+
430+
# ifdef __cpp_lib_constexpr_deque
431+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
427432
# endif
428433

429434
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -1299,7 +1304,11 @@
12991304
# endif
13001305

13011306
# ifdef __cpp_lib_constexpr_complex
1302-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
1307+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
1308+
# endif
1309+
1310+
# ifdef __cpp_lib_constexpr_deque
1311+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
13031312
# endif
13041313

13051314
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -2277,7 +2286,11 @@
22772286
# endif
22782287

22792288
# ifdef __cpp_lib_constexpr_complex
2280-
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
2289+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
2290+
# endif
2291+
2292+
# ifdef __cpp_lib_constexpr_deque
2293+
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
22812294
# endif
22822295

22832296
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -3488,11 +3501,15 @@
34883501
# error "__cpp_lib_constexpr_cmath should not be defined before c++23"
34893502
# endif
34903503

3491-
# ifndef __cpp_lib_constexpr_complex
3492-
# error "__cpp_lib_constexpr_complex should be defined in c++20"
3504+
# ifdef __cpp_lib_constexpr_complex
3505+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
34933506
# endif
3494-
# if __cpp_lib_constexpr_complex != 201711L
3495-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
3507+
3508+
# ifndef __cpp_lib_constexpr_deque
3509+
# error "__cpp_lib_constexpr_deque should be defined in c++20"
3510+
# endif
3511+
# if __cpp_lib_constexpr_deque != 202502L
3512+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
34963513
# endif
34973514

34983515
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -4928,11 +4945,15 @@
49284945
# endif
49294946
# endif
49304947

4931-
# ifndef __cpp_lib_constexpr_complex
4932-
# error "__cpp_lib_constexpr_complex should be defined in c++23"
4948+
# ifdef __cpp_lib_constexpr_complex
4949+
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
49334950
# endif
4934-
# if __cpp_lib_constexpr_complex != 201711L
4935-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
4951+
4952+
# ifndef __cpp_lib_constexpr_deque
4953+
# error "__cpp_lib_constexpr_deque should be defined in c++23"
4954+
# endif
4955+
# if __cpp_lib_constexpr_deque != 202502L
4956+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
49364957
# endif
49374958

49384959
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -6603,6 +6624,13 @@
66036624
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
66046625
# endif
66056626

6627+
# ifndef __cpp_lib_constexpr_deque
6628+
# error "__cpp_lib_constexpr_deque should be defined in c++26"
6629+
# endif
6630+
# if __cpp_lib_constexpr_deque != 202502L
6631+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26"
6632+
# endif
6633+
66066634
# ifndef __cpp_lib_constexpr_dynamic_alloc
66076635
# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26"
66086636
# endif

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,12 @@ def add_version_header(tc):
342342
},
343343
{
344344
"name": "__cpp_lib_constexpr_complex",
345-
"values": {"c++20": 201711},
345+
"values": {"c++26": 201711},
346+
"headers": ["deque"],
347+
},
348+
{
349+
"name": "__cpp_lib_constexpr_deque",
350+
"values": {"c++20": 202502},
346351
"headers": ["complex"],
347352
},
348353
{

0 commit comments

Comments
 (0)