[libcxx-commits] [libcxx] [libc++] Defer removal of _LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR to LLVM 25 (PR #211553)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 23 06:18:56 PDT 2026
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/211553
>From 6b080dcc6bec2e3507f8491ebfe7b77031bd1380 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 23 Jul 2026 08:20:14 -0400
Subject: [PATCH 1/2] [libc++] Defer removal of deprecated ABI escape hatches
to LLVM 25
Rather than removing the _LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR and
_LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF escape hatches in
LLVM 24, keep them around for another release since they haven't been widely
deployed yet. Reword the release notes as announcements of the future removal
in LLVM 25 and update the TODO markers accordingly.
---
libcxx/docs/ReleaseNotes/24.rst | 13 +++++++------
libcxx/include/__memory/allocator.h | 2 +-
libcxx/include/bitset | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/libcxx/docs/ReleaseNotes/24.rst b/libcxx/docs/ReleaseNotes/24.rst
index 70c704ff9d326..acd5d6dc50fe7 100644
--- a/libcxx/docs/ReleaseNotes/24.rst
+++ b/libcxx/docs/ReleaseNotes/24.rst
@@ -60,16 +60,17 @@ Potentially breaking changes
Announcements About Future Releases
-----------------------------------
+- ``std::allocator`` is trivially default constructible since LLVM 22. In LLVM 23 and LLVM 24, the ``_LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR``
+ macro was provided as an escape hatch to revert that change. This escape hatch will be removed in LLVM 25 if there is no
+ evidence of it being useful.
+
+- ``bitset::operator[]`` returns ``bool`` since LLVM 22, fixing a conformance bug. In LLVM 23 and LLVM 24, the ``_LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF``
+ macro was provided as an escape hatch to revert that change. This escape hatch will be removed in LLVM 25 if there is no
+ evidence of it being useful.
ABI Affecting Changes
---------------------
-- TODO: ``std::allocator`` is trivially default constructible since LLVM 22. In LLVM 23, the ``_LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR``
- macro was provided as an escape hatch, but it has been removed in LLVM 24 since there was no evidence of it being useful.
-
-- TODO: ``bitset::operator[]`` returns ``bool`` since LLVM 22, fixing a conformance bug. In LLVM 23, the ``_LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF``
- macro was provided as an escape hatch, but it has been removed in LLVM 24 since there was no evidence of it being useful.
-
Build System Changes
--------------------
diff --git a/libcxx/include/__memory/allocator.h b/libcxx/include/__memory/allocator.h
index 609b305a1250f..dd8c8647c178a 100644
--- a/libcxx/include/__memory/allocator.h
+++ b/libcxx/include/__memory/allocator.h
@@ -60,7 +60,7 @@ struct __non_trivially_default_constructible_if<true, _Unique> {
template <class _Tp>
class allocator
-// TODO(LLVM 24): Remove the opt-out
+// TODO(LLVM 25): Remove the opt-out
#ifdef _LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR
: __non_trivially_default_constructible_if<!is_void<_Tp>::value, allocator<_Tp> >
#endif
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index fd638daea8c73..3897a792d9a69 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -680,7 +680,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip(size_t __pos);
// element access:
- // TODO(LLVM 24): Remove the opt-out
+ // TODO(LLVM 25): Remove the opt-out
# ifndef _LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator[](size_t __p) const {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__p < _Size, "bitset::operator[] index out of bounds");
>From f4a4a7388800a88b0b424203a78540b4b1f0ff66 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 23 Jul 2026 09:18:43 -0400
Subject: [PATCH 2/2] Also defer bitset operator[]
---
libcxx/docs/ReleaseNotes/24.rst | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libcxx/docs/ReleaseNotes/24.rst b/libcxx/docs/ReleaseNotes/24.rst
index acd5d6dc50fe7..1c9e158e93214 100644
--- a/libcxx/docs/ReleaseNotes/24.rst
+++ b/libcxx/docs/ReleaseNotes/24.rst
@@ -60,13 +60,13 @@ Potentially breaking changes
Announcements About Future Releases
-----------------------------------
-- ``std::allocator`` is trivially default constructible since LLVM 22. In LLVM 23 and LLVM 24, the ``_LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR``
- macro was provided as an escape hatch to revert that change. This escape hatch will be removed in LLVM 25 if there is no
- evidence of it being useful.
+- ``std::allocator`` is trivially default constructible since LLVM 22. In LLVM 23 and LLVM 24, the
+ ``_LIBCPP_DEPRECATED_ABI_NON_TRIVIAL_ALLOCATOR`` macro was provided as an escape hatch to revert that change.
+ This escape hatch will be removed in LLVM 25 if there is no evidence of it being useful.
-- ``bitset::operator[]`` returns ``bool`` since LLVM 22, fixing a conformance bug. In LLVM 23 and LLVM 24, the ``_LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF``
- macro was provided as an escape hatch to revert that change. This escape hatch will be removed in LLVM 25 if there is no
- evidence of it being useful.
+- ``bitset::operator[]`` returns ``bool`` since LLVM 22, fixing a conformance bug. In LLVM 23 and LLVM 24, the
+ ``_LIBCPP_DEPRECATED_ABI_BITSET_CONST_SUBSCRIPT_RETURN_REF`` macro was provided as an escape hatch to revert
+ that change. This escape hatch will be removed in LLVM 25 if there is no evidence of it being useful.
ABI Affecting Changes
---------------------
More information about the libcxx-commits
mailing list