@@ -543,7 +543,11 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
543
543
}
544
544
545
545
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static __container_value_type* __get_ptr (__node_value_type& __n) {
546
- return std::addressof (__n.__get_value ());
546
+ // __n's lifetime has not begun, so calling __get_value is wrong
547
+
548
+ // return std::addressof(__n.__get_value());
549
+
550
+ return __node_value_type::__get_address_of_value (__n);
547
551
}
548
552
549
553
_LIBCPP_HIDE_FROM_ABI static pair<key_type&&, mapped_type&&> __move (__node_value_type& __v) { return __v.__move (); }
@@ -658,6 +662,7 @@ public:
658
662
__node_value_type __value_;
659
663
660
664
_LIBCPP_HIDE_FROM_ABI _Tp& __get_value () { return __value_; }
665
+ // _LIBCPP_HIDE_FROM_ABI static _Tp& __get_value_static(__tree_node * foo) { return (foo->__value_); }
661
666
662
667
~__tree_node () = delete ;
663
668
__tree_node (__tree_node const &) = delete ;
@@ -1816,8 +1821,9 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
1816
1821
1817
1822
template <class _Tp , class _Compare , class _Allocator >
1818
1823
template <class ... _Args>
1824
+ _LIBCPP_CONSTEXPR_SINCE_CXX26
1819
1825
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool >
1820
- _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args) {
1826
+ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args) {
1821
1827
__node_holder __h = __construct_node (std::forward<_Args>(__args)...);
1822
1828
__parent_pointer __parent;
1823
1829
__node_base_pointer& __child = __find_equal (__parent, __h->__value_ );
0 commit comments