Skip to content

Commit 10f536f

Browse files
Generate macro version correctly
1 parent 27f2bfe commit 10f536f

File tree

5 files changed

+64
-3
lines changed

5 files changed

+64
-3
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ Status
210210
---------------------------------------------------------- -----------------
211211
``__cpp_lib_constexpr_iterator`` ``201811L``
212212
---------------------------------------------------------- -----------------
213-
``__cpp_lib_constexpr_map`` ``202502L``
214-
---------------------------------------------------------- -----------------
215213
``__cpp_lib_constexpr_memory`` ``201811L``
216214
---------------------------------------------------------- -----------------
217215
``__cpp_lib_constexpr_numeric`` ``201911L``
@@ -420,6 +418,8 @@ Status
420418
---------------------------------------------------------- -----------------
421419
``__cpp_lib_constexpr_algorithms`` ``202306L``
422420
---------------------------------------------------------- -----------------
421+
``__cpp_lib_constexpr_map`` ``202502L``
422+
---------------------------------------------------------- -----------------
423423
``__cpp_lib_constexpr_new`` ``202406L``
424424
---------------------------------------------------------- -----------------
425425
``__cpp_lib_constrained_equality`` *unimplemented*

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ __cpp_lib_void_t 201411L <type_traits>
539539
# define __cpp_lib_bind_front 202306L
540540
# define __cpp_lib_bitset 202306L
541541
# undef __cpp_lib_constexpr_algorithms
542-
# define __cpp_lib_constexpr_map 202502L
543542
# define __cpp_lib_constexpr_algorithms 202306L
543+
# define __cpp_lib_constexpr_map 202502L
544544
# if !defined(_LIBCPP_ABI_VCRUNTIME)
545545
# define __cpp_lib_constexpr_new 202406L
546546
# endif

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
2020
__cpp_lib_associative_heterogeneous_erasure 202110L [C++23]
2121
__cpp_lib_associative_heterogeneous_insertion 202306L [C++26]
22+
__cpp_lib_constexpr_map 202502L [C++26]
2223
__cpp_lib_containers_ranges 202202L [C++23]
2324
__cpp_lib_erase_if 202002L [C++20]
2425
__cpp_lib_generic_associative_lookup 201304L [C++14]
@@ -46,6 +47,10 @@
4647
# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
4748
# endif
4849

50+
# ifdef __cpp_lib_constexpr_map
51+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
52+
# endif
53+
4954
# ifdef __cpp_lib_containers_ranges
5055
# error "__cpp_lib_containers_ranges should not be defined before c++23"
5156
# endif
@@ -88,6 +93,10 @@
8893
# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
8994
# endif
9095

96+
# ifdef __cpp_lib_constexpr_map
97+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
98+
# endif
99+
91100
# ifdef __cpp_lib_containers_ranges
92101
# error "__cpp_lib_containers_ranges should not be defined before c++23"
93102
# endif
@@ -136,6 +145,10 @@
136145
# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
137146
# endif
138147

148+
# ifdef __cpp_lib_constexpr_map
149+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
150+
# endif
151+
139152
# ifdef __cpp_lib_containers_ranges
140153
# error "__cpp_lib_containers_ranges should not be defined before c++23"
141154
# endif
@@ -193,6 +206,10 @@
193206
# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
194207
# endif
195208

209+
# ifdef __cpp_lib_constexpr_map
210+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
211+
# endif
212+
196213
# ifdef __cpp_lib_containers_ranges
197214
# error "__cpp_lib_containers_ranges should not be defined before c++23"
198215
# endif
@@ -262,6 +279,10 @@
262279
# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
263280
# endif
264281

282+
# ifdef __cpp_lib_constexpr_map
283+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
284+
# endif
285+
265286
# ifndef __cpp_lib_containers_ranges
266287
# error "__cpp_lib_containers_ranges should be defined in c++23"
267288
# endif
@@ -352,6 +373,13 @@
352373
# endif
353374
# endif
354375

376+
# ifndef __cpp_lib_constexpr_map
377+
# error "__cpp_lib_constexpr_map should be defined in c++26"
378+
# endif
379+
# if __cpp_lib_constexpr_map != 202502L
380+
# error "__cpp_lib_constexpr_map should have the value 202502L in c++26"
381+
# endif
382+
355383
# ifndef __cpp_lib_containers_ranges
356384
# error "__cpp_lib_containers_ranges should be defined in c++26"
357385
# endif

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
__cpp_lib_constexpr_dynamic_alloc 201907L [C++20]
6565
__cpp_lib_constexpr_functional 201907L [C++20]
6666
__cpp_lib_constexpr_iterator 201811L [C++20]
67+
__cpp_lib_constexpr_map 202502L [C++26]
6768
__cpp_lib_constexpr_memory 201811L [C++20]
6869
202202L [C++23]
6970
__cpp_lib_constexpr_new 202406L [C++26]
@@ -439,6 +440,10 @@
439440
# error "__cpp_lib_constexpr_iterator should not be defined before c++20"
440441
# endif
441442

443+
# ifdef __cpp_lib_constexpr_map
444+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
445+
# endif
446+
442447
# ifdef __cpp_lib_constexpr_memory
443448
# error "__cpp_lib_constexpr_memory should not be defined before c++20"
444449
# endif
@@ -1315,6 +1320,10 @@
13151320
# error "__cpp_lib_constexpr_iterator should not be defined before c++20"
13161321
# endif
13171322

1323+
# ifdef __cpp_lib_constexpr_map
1324+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
1325+
# endif
1326+
13181327
# ifdef __cpp_lib_constexpr_memory
13191328
# error "__cpp_lib_constexpr_memory should not be defined before c++20"
13201329
# endif
@@ -2293,6 +2302,10 @@
22932302
# error "__cpp_lib_constexpr_iterator should not be defined before c++20"
22942303
# endif
22952304

2305+
# ifdef __cpp_lib_constexpr_map
2306+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
2307+
# endif
2308+
22962309
# ifdef __cpp_lib_constexpr_memory
22972310
# error "__cpp_lib_constexpr_memory should not be defined before c++20"
22982311
# endif
@@ -3517,6 +3530,10 @@
35173530
# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
35183531
# endif
35193532

3533+
# ifdef __cpp_lib_constexpr_map
3534+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
3535+
# endif
3536+
35203537
# ifndef __cpp_lib_constexpr_memory
35213538
# error "__cpp_lib_constexpr_memory should be defined in c++20"
35223539
# endif
@@ -4957,6 +4974,10 @@
49574974
# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23"
49584975
# endif
49594976

4977+
# ifdef __cpp_lib_constexpr_map
4978+
# error "__cpp_lib_constexpr_map should not be defined before c++26"
4979+
# endif
4980+
49604981
# ifndef __cpp_lib_constexpr_memory
49614982
# error "__cpp_lib_constexpr_memory should be defined in c++23"
49624983
# endif
@@ -6625,6 +6646,13 @@
66256646
# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26"
66266647
# endif
66276648

6649+
# ifndef __cpp_lib_constexpr_map
6650+
# error "__cpp_lib_constexpr_map should be defined in c++26"
6651+
# endif
6652+
# if __cpp_lib_constexpr_map != 202502L
6653+
# error "__cpp_lib_constexpr_map should have the value 202502L in c++26"
6654+
# endif
6655+
66286656
# ifndef __cpp_lib_constexpr_memory
66296657
# error "__cpp_lib_constexpr_memory should be defined in c++26"
66306658
# endif

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ def add_version_header(tc):
360360
"values": {"c++20": 201811},
361361
"headers": ["iterator"],
362362
},
363+
{
364+
"name": "__cpp_lib_constexpr_map",
365+
"values": {"c++26": 202502},
366+
"headers": ["map"],
367+
},
363368
{
364369
"name": "__cpp_lib_constexpr_memory",
365370
"values": {"c++20": 201811, "c++23": 202202},

0 commit comments

Comments
 (0)