Skip to content

Commit 82e293b

Browse files
fix FTM and constexpr macro
1 parent 00e3607 commit 82e293b

File tree

7 files changed

+73
-73
lines changed

7 files changed

+73
-73
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 2 additions & 2 deletions
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_deque`` ``202502L``
205+
``__cpp_lib_constexpr_complex`` ``201711L``
206206
---------------------------------------------------------- -----------------
207207
``__cpp_lib_constexpr_dynamic_alloc`` ``201907L``
208208
---------------------------------------------------------- -----------------
@@ -416,7 +416,7 @@ Status
416416
---------------------------------------------------------- -----------------
417417
``__cpp_lib_bitset`` ``202306L``
418418
---------------------------------------------------------- -----------------
419-
``__cpp_lib_constexpr_complex`` ``201711L``
419+
``__cpp_lib_constexpr_deque`` ``202502L``
420420
---------------------------------------------------------- -----------------
421421
``__cpp_lib_constexpr_new`` ``202406L``
422422
---------------------------------------------------------- -----------------

libcxx/include/deque

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
25432543
}
25442544

25452545
template <class _Tp, class _Allocator>
2546-
inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr bool
2546+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
25472547
operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
25482548
const typename deque<_Tp, _Allocator>::size_type __sz = __x.size();
25492549
return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
@@ -2579,30 +2579,30 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
25792579
# else // _LIBCPP_STD_VER <= 17
25802580

25812581
template <class _Tp, class _Allocator>
2582-
_LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Tp> constexpr
2582+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Tp>
25832583
operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
25842584
return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
25852585
}
25862586

25872587
# endif // _LIBCPP_STD_VER <= 17
25882588

25892589
template <class _Tp, class _Allocator>
2590-
inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
2590+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
25912591
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
25922592
__x.swap(__y);
25932593
}
25942594

25952595
# if _LIBCPP_STD_VER >= 20
25962596
template <class _Tp, class _Allocator, class _Up>
2597-
inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr typename deque<_Tp, _Allocator>::size_type
2597+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::size_type
25982598
erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
25992599
auto __old_size = __c.size();
26002600
__c.erase(std::remove(__c.begin(), __c.end(), __v), __c.end());
26012601
return __old_size - __c.size();
26022602
}
26032603

26042604
template <class _Tp, class _Allocator, class _Predicate>
2605-
inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr typename deque<_Tp, _Allocator>::size_type
2605+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::size_type
26062606
erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) {
26072607
auto __old_size = __c.size();
26082608
__c.erase(std::remove_if(__c.begin(), __c.end(), __pred), __c.end());

libcxx/include/version

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +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 <deque>
68-
__cpp_lib_constexpr_deque 202502L <complex>
67+
__cpp_lib_constexpr_complex 201711L <complex>
68+
__cpp_lib_constexpr_deque 202502L <deque>
6969
__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
7070
__cpp_lib_constexpr_functional 201907L <functional>
7171
__cpp_lib_constexpr_iterator 201811L <iterator>
@@ -399,7 +399,7 @@ __cpp_lib_void_t 201411L <type_traits>
399399
# endif
400400
# define __cpp_lib_concepts 202002L
401401
# define __cpp_lib_constexpr_algorithms 201806L
402-
# define __cpp_lib_constexpr_deque 202502L
402+
# define __cpp_lib_constexpr_complex 201711L
403403
# define __cpp_lib_constexpr_dynamic_alloc 201907L
404404
# define __cpp_lib_constexpr_functional 201907L
405405
# define __cpp_lib_constexpr_iterator 201811L
@@ -537,7 +537,7 @@ __cpp_lib_void_t 201411L <type_traits>
537537
# undef __cpp_lib_bind_front
538538
# define __cpp_lib_bind_front 202306L
539539
# define __cpp_lib_bitset 202306L
540-
# define __cpp_lib_constexpr_complex 201711L
540+
# define __cpp_lib_constexpr_deque 202502L
541541
# if !defined(_LIBCPP_ABI_VCRUNTIME)
542542
# define __cpp_lib_constexpr_new 202406L
543543
# 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_deque 202502L [C++20]
18+
/* Constant Value
19+
__cpp_lib_complex_udls 201309L [C++14]
20+
__cpp_lib_constexpr_complex 201711L [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_deque
33-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
32+
# ifdef __cpp_lib_constexpr_complex
33+
# error "__cpp_lib_constexpr_complex 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_deque
46-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
45+
# ifdef __cpp_lib_constexpr_complex
46+
# error "__cpp_lib_constexpr_complex 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_deque
59-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
58+
# ifdef __cpp_lib_constexpr_complex
59+
# error "__cpp_lib_constexpr_complex 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_deque
72-
# error "__cpp_lib_constexpr_deque should be defined in c++20"
71+
# ifndef __cpp_lib_constexpr_complex
72+
# error "__cpp_lib_constexpr_complex should be defined in c++20"
7373
# endif
74-
# if __cpp_lib_constexpr_deque != 202502L
75-
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
74+
# if __cpp_lib_constexpr_complex != 201711L
75+
# error "__cpp_lib_constexpr_complex should have the value 201711L 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_deque
88-
# error "__cpp_lib_constexpr_deque should be defined in c++23"
87+
# ifndef __cpp_lib_constexpr_complex
88+
# error "__cpp_lib_constexpr_complex should be defined in c++23"
8989
# endif
90-
# if __cpp_lib_constexpr_deque != 202502L
91-
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
90+
# if __cpp_lib_constexpr_complex != 201711L
91+
# error "__cpp_lib_constexpr_complex should have the value 201711L 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_deque
104-
# error "__cpp_lib_constexpr_deque should be defined in c++26"
103+
# ifndef __cpp_lib_constexpr_complex
104+
# error "__cpp_lib_constexpr_complex should be defined in c++26"
105105
# endif
106-
# if __cpp_lib_constexpr_deque != 202502L
107-
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26"
106+
# if __cpp_lib_constexpr_complex != 201711L
107+
# error "__cpp_lib_constexpr_complex should have the value 201711L 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: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +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]
20+
__cpp_lib_constexpr_deque 202502L [C++26]
2121
__cpp_lib_containers_ranges 202202L [C++23]
2222
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
2323
__cpp_lib_erase_if 202002L [C++20]
@@ -33,8 +33,8 @@
3333
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
3434
# endif
3535

36-
# ifdef __cpp_lib_constexpr_complex
37-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
36+
# ifdef __cpp_lib_constexpr_deque
37+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
3838
# endif
3939

4040
# ifdef __cpp_lib_containers_ranges
@@ -59,8 +59,8 @@
5959
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
6060
# endif
6161

62-
# ifdef __cpp_lib_constexpr_complex
63-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
62+
# ifdef __cpp_lib_constexpr_deque
63+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
6464
# endif
6565

6666
# ifdef __cpp_lib_containers_ranges
@@ -88,8 +88,8 @@
8888
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
8989
# endif
9090

91-
# ifdef __cpp_lib_constexpr_complex
92-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
91+
# ifdef __cpp_lib_constexpr_deque
92+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
9393
# endif
9494

9595
# ifdef __cpp_lib_containers_ranges
@@ -120,8 +120,8 @@
120120
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
121121
# endif
122122

123-
# ifdef __cpp_lib_constexpr_complex
124-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
123+
# ifdef __cpp_lib_constexpr_deque
124+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
125125
# endif
126126

127127
# ifdef __cpp_lib_containers_ranges
@@ -155,8 +155,8 @@
155155
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
156156
# endif
157157

158-
# ifdef __cpp_lib_constexpr_complex
159-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
158+
# ifdef __cpp_lib_constexpr_deque
159+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
160160
# endif
161161

162162
# ifndef __cpp_lib_containers_ranges
@@ -193,11 +193,11 @@
193193
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
194194
# endif
195195

196-
# ifndef __cpp_lib_constexpr_complex
197-
# error "__cpp_lib_constexpr_complex should be defined in c++26"
196+
# ifndef __cpp_lib_constexpr_deque
197+
# error "__cpp_lib_constexpr_deque should be defined in c++26"
198198
# endif
199-
# if __cpp_lib_constexpr_complex != 201711L
200-
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
199+
# if __cpp_lib_constexpr_deque != 202502L
200+
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26"
201201
# endif
202202

203203
# ifndef __cpp_lib_containers_ranges

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +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++26]
63-
__cpp_lib_constexpr_deque 202502L [C++20]
62+
__cpp_lib_constexpr_complex 201711L [C++20]
63+
__cpp_lib_constexpr_deque 202502L [C++26]
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]
@@ -424,11 +424,11 @@
424424
# endif
425425

426426
# ifdef __cpp_lib_constexpr_complex
427-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
427+
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
428428
# endif
429429

430430
# ifdef __cpp_lib_constexpr_deque
431-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
431+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
432432
# endif
433433

434434
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -1304,11 +1304,11 @@
13041304
# endif
13051305

13061306
# ifdef __cpp_lib_constexpr_complex
1307-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
1307+
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
13081308
# endif
13091309

13101310
# ifdef __cpp_lib_constexpr_deque
1311-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
1311+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
13121312
# endif
13131313

13141314
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -2286,11 +2286,11 @@
22862286
# endif
22872287

22882288
# ifdef __cpp_lib_constexpr_complex
2289-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
2289+
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
22902290
# endif
22912291

22922292
# ifdef __cpp_lib_constexpr_deque
2293-
# error "__cpp_lib_constexpr_deque should not be defined before c++20"
2293+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
22942294
# endif
22952295

22962296
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -3501,15 +3501,15 @@
35013501
# error "__cpp_lib_constexpr_cmath should not be defined before c++23"
35023502
# endif
35033503

3504-
# ifdef __cpp_lib_constexpr_complex
3505-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
3504+
# ifndef __cpp_lib_constexpr_complex
3505+
# error "__cpp_lib_constexpr_complex should be defined in c++20"
35063506
# endif
3507-
3508-
# ifndef __cpp_lib_constexpr_deque
3509-
# error "__cpp_lib_constexpr_deque should be defined in c++20"
3507+
# if __cpp_lib_constexpr_complex != 201711L
3508+
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
35103509
# endif
3511-
# if __cpp_lib_constexpr_deque != 202502L
3512-
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
3510+
3511+
# ifdef __cpp_lib_constexpr_deque
3512+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
35133513
# endif
35143514

35153515
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -4945,15 +4945,15 @@
49454945
# endif
49464946
# endif
49474947

4948-
# ifdef __cpp_lib_constexpr_complex
4949-
# error "__cpp_lib_constexpr_complex should not be defined before c++26"
4948+
# ifndef __cpp_lib_constexpr_complex
4949+
# error "__cpp_lib_constexpr_complex should be defined in c++23"
49504950
# endif
4951-
4952-
# ifndef __cpp_lib_constexpr_deque
4953-
# error "__cpp_lib_constexpr_deque should be defined in c++23"
4951+
# if __cpp_lib_constexpr_complex != 201711L
4952+
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
49544953
# endif
4955-
# if __cpp_lib_constexpr_deque != 202502L
4956-
# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
4954+
4955+
# ifdef __cpp_lib_constexpr_deque
4956+
# error "__cpp_lib_constexpr_deque should not be defined before c++26"
49574957
# endif
49584958

49594959
# ifndef __cpp_lib_constexpr_dynamic_alloc

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ def add_version_header(tc):
342342
},
343343
{
344344
"name": "__cpp_lib_constexpr_complex",
345-
"values": {"c++26": 201711},
346-
"headers": ["deque"],
345+
"values": {"c++20": 201711},
346+
"headers": ["complex"],
347347
},
348348
{
349349
"name": "__cpp_lib_constexpr_deque",
350-
"values": {"c++20": 202502},
351-
"headers": ["complex"],
350+
"values": {"c++26": 202502},
351+
"headers": ["deque"],
352352
},
353353
{
354354
"name": "__cpp_lib_constexpr_dynamic_alloc",

0 commit comments

Comments
 (0)