Skip to content

Commit 64fcbfd

Browse files
committed
Rebase onto main to resolve conflicts
1 parent 58924b7 commit 64fcbfd

File tree

5 files changed

+60
-6653
lines changed

5 files changed

+60
-6653
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,9 @@ Status
418418
---------------------------------------------------------- -----------------
419419
``__cpp_lib_bitset`` ``202306L``
420420
---------------------------------------------------------- -----------------
421-
<<<<<<< HEAD
422421
``__cpp_lib_constexpr_algorithms`` ``202306L``
423-
=======
422+
---------------------------------------------------------- -----------------
424423
``__cpp_lib_constexpr_forward_list`` ``202502L``
425-
>>>>>>> 3e1b3b8f0316 (Make forward_list constexpr as part of P3372R3)
426424
---------------------------------------------------------- -----------------
427425
``__cpp_lib_constexpr_new`` ``202406L``
428426
---------------------------------------------------------- -----------------

libcxx/include/__memory/pointer_traits.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p
302302

303303
#endif
304304

305+
// This function ensures safe conversions between fancy pointers at compile-time, where we avoid casts from/to
306+
// `__void_pointer` by obtaining the underlying raw pointer from the fancy pointer using `std::to_address`,
307+
// then dereferencing it to retrieve the pointed-to object, and finally constructing the target fancy pointer
308+
// to that object using the `std::pointer_traits<>::pinter_to` function.
305309
template <class _PtrTo, class _PtrFrom>
306310
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _PtrTo __static_fancy_pointer_cast(const _PtrFrom& __p) {
307311
using __ptr_traits = pointer_traits<_PtrTo>;

libcxx/include/forward_list

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,8 @@ public:
844844
}
845845
# endif // _LIBCPP_CXX03_LANG
846846
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v);
847-
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v) {
847+
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI iterator
848+
insert_after(const_iterator __p, size_type __n, const value_type& __v) {
848849
return __insert_after(__p, __n, __v);
849850
}
850851
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
2525
# endif
2626

27+
# ifdef __cpp_lib_constexpr_forward_list
28+
# error "__cpp_lib_constexpr_forward_list should not be defined before c++26"
29+
# endif
30+
2731
# ifdef __cpp_lib_containers_ranges
2832
# error "__cpp_lib_containers_ranges should not be defined before c++23"
2933
# endif
@@ -54,6 +58,10 @@
5458
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
5559
# endif
5660

61+
# ifdef __cpp_lib_constexpr_forward_list
62+
# error "__cpp_lib_constexpr_forward_list should not be defined before c++26"
63+
# endif
64+
5765
# ifdef __cpp_lib_containers_ranges
5866
# error "__cpp_lib_containers_ranges should not be defined before c++23"
5967
# endif
@@ -87,6 +95,10 @@
8795
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
8896
# endif
8997

98+
# ifdef __cpp_lib_constexpr_forward_list
99+
# error "__cpp_lib_constexpr_forward_list should not be defined before c++26"
100+
# endif
101+
90102
# ifdef __cpp_lib_containers_ranges
91103
# error "__cpp_lib_containers_ranges should not be defined before c++23"
92104
# endif
@@ -126,6 +138,10 @@
126138
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
127139
# endif
128140

141+
# ifdef __cpp_lib_constexpr_forward_list
142+
# error "__cpp_lib_constexpr_forward_list should not be defined before c++26"
143+
# endif
144+
129145
# ifdef __cpp_lib_containers_ranges
130146
# error "__cpp_lib_containers_ranges should not be defined before c++23"
131147
# endif
@@ -171,6 +187,10 @@
171187
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
172188
# endif
173189

190+
# ifdef __cpp_lib_constexpr_forward_list
191+
# error "__cpp_lib_constexpr_forward_list should not be defined before c++26"
192+
# endif
193+
174194
# ifndef __cpp_lib_containers_ranges
175195
# error "__cpp_lib_containers_ranges should be defined in c++23"
176196
# endif
@@ -219,6 +239,13 @@
219239
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
220240
# endif
221241

242+
# ifndef __cpp_lib_constexpr_forward_list
243+
# error "__cpp_lib_constexpr_forward_list should be defined in c++26"
244+
# endif
245+
# if __cpp_lib_constexpr_forward_list != 202502L
246+
# error "__cpp_lib_constexpr_forward_list should have the value 202502L in c++26"
247+
# endif
248+
222249
# ifndef __cpp_lib_containers_ranges
223250
# error "__cpp_lib_containers_ranges should be defined in c++26"
224251
# endif

0 commit comments

Comments
 (0)