Skip to content

Commit cca780a

Browse files
fails largely because of constexpr limit, because for Container<int, MoveOnly> c, issues happen similar to move_alloc move_assign
1 parent c2f8451 commit cca780a

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

libcxx/include/__memory/pointer_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p
255255
// This function ensures safe conversions between fancy pointers at compile-time, where we avoid casts from/to
256256
// `__void_pointer` by obtaining the underlying raw pointer from the fancy pointer using `std::to_address`,
257257
// then dereferencing it to retrieve the pointed-to object, and finally constructing the target fancy pointer
258-
// to that object using the `std::pointer_traits<>::pinter_to` function.
258+
// to that object using the `std::pointer_traits<>::pointer_to` function.
259259
template <class _PtrTo, class _PtrFrom>
260260
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _PtrTo __static_fancy_pointer_cast(const _PtrFrom& __p) {
261261
using __ptr_traits = pointer_traits<_PtrTo>;

libcxx/include/__tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,13 @@ private:
911911

912912
public:
913913
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __root() const _NOEXCEPT {
914+
// double t = __end_node()->__left_;
915+
using __ptr_traits = pointer_traits<__node_pointer>;
916+
using __element_type = typename __ptr_traits::element_type;
917+
typename __element_type_type x{};
918+
double t = x;
914919
return std::__static_fancy_pointer_cast<__node_pointer>(__end_node()->__left_);
920+
// return static_cast<__node_pointer>(__end_node()->__left_);
915921
}
916922

917923
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer* __root_ptr() const _NOEXCEPT {

libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
3434

3535
test_map_insert_range_move_only<std::map>();
3636

37+
#ifndef TEST_IS_CONSTANT_EVALUATED
3738
test_map_insert_range_exception_safety_throwing_copy<std::map>();
3839
test_assoc_map_insert_range_exception_safety_throwing_allocator<std::map, int, int>();
40+
#endif
3941
return true;
4042
}
4143

libcxx/test/std/containers/insert_range_maps_sets.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,14 @@ void test_set_insert_range_move_only() {
259259
}
260260

261261
template <template <class...> class Container>
262-
void test_map_insert_range_move_only() {
262+
TEST_CONSTEXPR_CXX26 bool test_map_insert_range_move_only() {
263263
using Value = std::pair<const int, MoveOnly>;
264264
Value input[5];
265265
std::ranges::subrange in(std::move_iterator{input}, std::move_iterator{input + 5});
266266

267267
Container<int, MoveOnly> c;
268268
c.insert_range(in);
269+
return true;
269270
}
270271

271272
// Exception safety.

0 commit comments

Comments
 (0)