Skip to content

Commit 46164d8

Browse files
committed
Fix __as_link()
1 parent 7950727 commit 46164d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcxx/include/list

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ public:
342342
: __base(__prev, __next) {}
343343
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI ~__list_node() {}
344344

345-
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __base_pointer __as_link() { return __base::__self(); }
345+
_LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __base_pointer __as_link() {
346+
return pointer_traits<__base_pointer>::pointer_to(
347+
*static_cast<typename pointer_traits<__base_pointer>::element_type*>(std::addressof(*this)));
348+
}
346349
};
347350

348351
template <class _Tp, class _Alloc = allocator<_Tp> >

0 commit comments

Comments
 (0)