[libcxx-commits] [libcxx] [libc++] Remove unused type_info constructor (PR #235739)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 30 06:19:11 PDT 2026


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/235739

>From 6adad3f84fa8c58c52fbb0761fd4b21648f04e40 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Mon, 26 Oct 2026 12:46:05 +0100
Subject: [PATCH] [libc++] Remove unused type_info constructor

---
 libcxx/docs/ReleaseNotes/24.rst | 2 ++
 libcxx/include/typeinfo         | 9 ---------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/libcxx/docs/ReleaseNotes/24.rst b/libcxx/docs/ReleaseNotes/24.rst
index a22d7f1a2e468e..2d02f253e3ecb1 100644
--- a/libcxx/docs/ReleaseNotes/24.rst
+++ b/libcxx/docs/ReleaseNotes/24.rst
@@ -85,6 +85,8 @@ Potentially breaking changes
   Specifically, when an exception is thrown, the appended elements are now destructed from first to last instead of
   last to first.
 
+- ``type_info`` no longer provides a protected constructor taking a ``const char*``.
+
 Announcements About Future Releases
 -----------------------------------
 
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index aca6b91768d095..f75daeed08fba3 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -195,10 +195,6 @@ struct __string_impl_base {
   __type_name_to_string(__type_name_t __v) _NOEXCEPT {
     return __v;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR static __type_name_t
-  __string_to_type_name(const char* __v) _NOEXCEPT {
-    return __v;
-  }
 };
 
 struct __unique_impl : __string_impl_base {
@@ -234,9 +230,6 @@ struct __non_unique_arm_rtti_bit_impl {
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static const char* __type_name_to_string(__type_name_t __v) _NOEXCEPT {
     return reinterpret_cast<const char*>(__v & ~__non_unique_rtti_bit::value);
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static __type_name_t __string_to_type_name(const char* __v) _NOEXCEPT {
-    return reinterpret_cast<__type_name_t>(__v);
-  }
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static size_t __hash(__type_name_t __v) _NOEXCEPT {
     if (__is_type_name_unique(__v))
@@ -304,8 +297,6 @@ protected:
 
   _LIBCPP_DISABLE_POINTER_FIELD_PROTECTION __impl::__type_name_t __type_name;
 
-  _LIBCPP_HIDE_FROM_ABI explicit type_info(const char* __n) : __type_name(__impl::__string_to_type_name(__n)) {}
-
 public:
   virtual ~type_info();
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char* name() const _NOEXCEPT {



More information about the libcxx-commits mailing list