[libcxx-commits] [libcxx] [libc++] Take the ABI break for `std::list`'s pointer UB unconditionally (PR #100585)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 15 08:55:36 PDT 2024


================
@@ -332,12 +320,12 @@ public:
 #endif
 
   typedef __list_node_base<_Tp, _VoidPtr> __base;
-  typedef typename __base::__link_pointer __link_pointer;
+  typedef typename __base::__base_pointer __base_pointer;
 
-  _LIBCPP_HIDE_FROM_ABI explicit __list_node(__link_pointer __prev, __link_pointer __next) : __base(__prev, __next) {}
+  _LIBCPP_HIDE_FROM_ABI explicit __list_node(__base_pointer __prev, __base_pointer __next) : __base(__prev, __next) {}
   _LIBCPP_HIDE_FROM_ABI ~__list_node() {}
 
-  _LIBCPP_HIDE_FROM_ABI __link_pointer __as_link() { return static_cast<__link_pointer>(__base::__self()); }
+  _LIBCPP_HIDE_FROM_ABI __base_pointer __as_link() { return __base::__self(); }
----------------
ldionne wrote:

It would be nice to clean up this `__as_link` function as a follow-up.

https://github.com/llvm/llvm-project/pull/100585


More information about the libcxx-commits mailing list