Skip to content

Commit e9bdbb7

Browse files
index_key.pass.cpp -> static_assert
error: static assertion failed due to requirement 'std::is_same<std::__tree_node<std::__value_type<CopyInsertable<1>, CopyInsertable<2>>, void *>, std::pair<const CopyInsertable<1>, CopyInsertable<2>>>::value': Only allowed to construct Up
1 parent 17f8361 commit e9bdbb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcxx/include/__tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ private:
707707
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT
708708
: __ptr_(__p) {}
709709
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __get_np() const {
710-
return static_cast<__node_pointer>(__ptr_);
710+
return std::__static_fancy_pointer_cast<__node_pointer>(__ptr_);
711711
}
712712
template <class, class, class>
713713
friend class __tree;
@@ -1716,7 +1716,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(__end_node_pointer& __parent, co
17161716
__nd_ptr = std::addressof(__nd->__right_);
17171717
__nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__right_);
17181718
} else {
1719-
__parent = static_cast<__end_node_pointer>(__nd);
1719+
__parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__nd);
17201720
return __nd->__right_;
17211721
}
17221722
} else {
@@ -1800,7 +1800,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool> _LIBCPP_CONSTEX
18001800
__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args) {
18011801
__end_node_pointer __parent;
18021802
__node_base_pointer& __child = __find_equal(__parent, __k);
1803-
__node_pointer __r = static_cast<__node_pointer>(__child);
1803+
__node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
18041804
bool __inserted = false;
18051805
if (__child == nullptr) {
18061806
__node_holder __h = __construct_node(std::forward<_Args>(__args)...);

0 commit comments

Comments
 (0)