[libcxx-commits] [libcxx] [libc++] Remove unused __parent_pointer alias from __tree and map (PR #172185)

Andrei Topala via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 13 15:54:41 PST 2025


https://github.com/Krechals created https://github.com/llvm/llvm-project/pull/172185

The `__parent_pointer` type alias was marked to be removed in d163ab3323495560eb0255ac807da2bf24d3c629.
At that time, <map> still had uses of `__parent_pointer` as a local variable type in operator[] and at()

Those uses were removed in 4a2dd31f16d60b65a46696a909efad5c11b18c19, which refactored `__find_equal` to return a pair instead of using an out parameter

However, the typedef in <map> and the alias in __tree were left behind

This patch removes the unused typedef from <map> and the `__parent_pointer` alias from __tree


>From 0650724efd940c32eb2765d448b7f7efbe92e8b9 Mon Sep 17 00:00:00 2001
From: Krechals <topala.andrei at gmail.com>
Date: Sat, 13 Dec 2025 23:50:48 +0000
Subject: [PATCH] [libc++] Remove unused __parent_pointer alias from __tree and
 map

Signed-off-by: Krechals <topala.andrei at gmail.com>
---
 libcxx/include/__tree | 2 --
 libcxx/include/map    | 1 -
 2 files changed, 3 deletions(-)

diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index 22aa186470bda..6f81c6d2bf9fd 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -907,8 +907,6 @@ public:
   using __end_node_t _LIBCPP_NODEBUG       = __tree_end_node<__node_base_pointer>;
   using __end_node_pointer _LIBCPP_NODEBUG = __rebind_pointer_t<__void_pointer, __end_node_t>;
 
-  using __parent_pointer _LIBCPP_NODEBUG = __end_node_pointer; // TODO: Remove this once the uses in <map> are removed
-
   using __node_allocator _LIBCPP_NODEBUG = __rebind_alloc<__alloc_traits, __node>;
   using __node_traits _LIBCPP_NODEBUG    = allocator_traits<__node_allocator>;
 
diff --git a/libcxx/include/map b/libcxx/include/map
index 2f5bcba6835c9..324c8d69be735 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -1418,7 +1418,6 @@ private:
   typedef typename __base::__node_allocator __node_allocator;
   typedef typename __base::__node_pointer __node_pointer;
   typedef typename __base::__node_base_pointer __node_base_pointer;
-  typedef typename __base::__parent_pointer __parent_pointer;
 
   typedef __map_node_destructor<__node_allocator> _Dp;
   typedef unique_ptr<__node, _Dp> __node_holder;



More information about the libcxx-commits mailing list