Skip to content

Commit a5d575d

Browse files
fix same_as allocate issues in index_rv_key
1 parent 325c9b7 commit a5d575d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libcxx/include/__tree

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,8 +1879,6 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
18791879
const_iterator __p, _Key const& __k, _Args&&... __args) {
18801880
__end_node_pointer __parent;
18811881
__node_base_pointer __dummy;
1882-
// min_pointer<std::__tree_node_base<min_pointer<void>>>
1883-
18841882
__node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
18851883
__node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
18861884
bool __inserted = false;
@@ -1899,8 +1897,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node
18991897
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
19001898
__node_allocator& __na = __node_alloc();
19011899
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1902-
__node_traits::construct(__na, std::addressof(*__h), std::forward<_Args>(__args)...);
1903-
// __node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);
1900+
// here.... for same_as failure
1901+
// __node_traits::construct(__na, std::addressof(*__h), std::forward<_Args>(__args)...);
1902+
__node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);
19041903
// note: construction of subobject of object outside its lifetime is not allowed in a constant expression
19051904
__h.get_deleter().__value_constructed = true;
19061905
return __h;

0 commit comments

Comments
 (0)