[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:18:24 PDT 2026
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/235739
>From d6fb872f09357f08da8c817fa6b209165e0aa50a 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 04f02ab66a773c..b95ed8305481a8 100644
--- a/libcxx/docs/ReleaseNotes/24.rst
+++ b/libcxx/docs/ReleaseNotes/24.rst
@@ -81,6 +81,8 @@ Potentially breaking changes
- libc++ no longer depends on msvcprt/libcpmt in the MSVC mode.
+- ``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