Skip to content

Commit 2f72b14

Browse files
committed
[libc++][doc] Updates the release notes.
This is a preparation for the upcoming LLVM 18 release.
1 parent 5b7bb56 commit 2f72b14

File tree

4 files changed

+74
-20
lines changed

4 files changed

+74
-20
lines changed

libcxx/docs/Hardening.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _hardening-modes:
2+
13
===============
24
Hardening Modes
35
===============

libcxx/docs/ReleaseNotes/18.rst

Lines changed: 70 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,26 @@ see the `releases page <https://llvm.org/releases/>`_.
3535
What's New in Libc++ 18.0.0?
3636
==============================
3737

38-
- A new debug mode has been added, replacing the legacy debug mode that was
39-
removed in the LLVM 17 release. See ``libcxx/docs/Hardening.rst`` for more
40-
details.
38+
The main focus of the libc++ team has been to implement new C++20, C++23,
39+
and C++26 features.
40+
41+
New hardened modes for the library have been added, replacing the legacy debug mode that was
42+
removed in the LLVM 17 release. Unlike the legacy debug mode, some of these hardening modes are
43+
also intended to be used in production. See :ref:`hardening-modes` for more details.
44+
45+
Work on the ranges support has progressed. See
46+
:ref:`ranges-status` for the current status.
47+
48+
Work on the experimental C++23 module support has progressed. The ``std.compat``
49+
module is available and the feature is retroactively available in C++20. See
50+
:ref:`ModulesInLibcxx` for more information.
51+
52+
Work on the experimental C++17 Parallel STL has progressed. See
53+
:ref:`pstl-status` for the current status.
54+
55+
Work on the experimental C++17 SIMD support has progressed. See
56+
:ref:`parallelism-status` for the current status.
57+
4158

4259
Implemented Papers
4360
------------------
@@ -68,8 +85,9 @@ Implemented Papers
6885
Improvements and New Features
6986
-----------------------------
7087

71-
- ``std::ranges::count`` is now optimized for ``vector<bool>::iterator``, which
72-
can lead up to 350x performance improvements.
88+
- ``std::ranges::count`` and ``std::ranges::find`` are now optimized for
89+
``std::vector<bool>::iterator``, which can lead up to 350x performance
90+
improvements.
7391

7492
- ``std::for_each`` has been optimized for segmented iterators like ``std::deque::iterator`` in C++23 and
7593
later, which can lead up to 40x performance improvements.
@@ -106,6 +124,11 @@ Improvements and New Features
106124
``-DLIBCXX_INSTALL_MODULE_DIR=<path>``. The default location is
107125
``${PREFIX}/share/libc++/v1``.
108126

127+
- AddressSanitizer annotations have been added to ``std::basic_string``.
128+
129+
- The libc++ source code has been formatted with ``clang-format``. This
130+
`discourse thread <https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all>`_
131+
contains information how to rebase downstream patches.
109132

110133
Deprecations and Removals
111134
-------------------------
@@ -118,7 +141,7 @@ Deprecations and Removals
118141
- The non-conforming constructor ``std::future_error(std::error_code)`` has been removed. Please use the
119142
``std::future_error(std::future_errc)`` constructor provided in C++17 instead.
120143

121-
- `P1957 <https://wg21.link/P1957>` has been implemented in Clang and libc++ removed a code path that led to
144+
- `P1957 <https://wg21.link/P1957>`_ has been implemented in Clang and libc++ removed a code path that led to
122145
narrowing conversions in ``std::variant`` behaving in a non-standard way. This may change how some uses of
123146
``std::variant``'s constructor behave in user code. The ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT``
124147
macro is provided to restore the previous behavior, and it will be supported in the LLVM 18 release only.
@@ -155,6 +178,14 @@ Deprecations and Removals
155178
that were removed in the C++17 and C++20 standards. Instead of using these
156179
macros, please use the macros to re-enable individual features.
157180

181+
- The macro ``_LIBCPP_INLINE_VISIBILITY`` has been deprecated in LLVM 18 and
182+
will be removed entirely in LLVM 19. The macro ``_LIBCPP_HIDE_FROM_ABI`` is
183+
the drop-in replacement.
184+
185+
- The macro ``_VSTD`` has been deprecated in LLVM 18 and will be removed
186+
entirely in LLVM 19. The code ``std`` is the drop-in replacement.
187+
188+
158189
Upcoming Deprecations and Removals
159190
----------------------------------
160191

@@ -163,6 +194,9 @@ Upcoming Deprecations and Removals
163194
LLVM 19
164195
~~~~~~~
165196

197+
- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. LLVM 19 will
198+
completely remove support for the ``*_EXECUTOR`` variables.
199+
166200
- The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable that was used to enable the safe mode will be deprecated and setting
167201
it will trigger an error; use the ``LIBCXX_HARDENING_MODE`` variable with the value ``extensive`` instead. Similarly,
168202
the ``_LIBCPP_ENABLE_ASSERTIONS`` macro will be deprecated (setting it to ``1`` still enables the extensive mode in
@@ -187,6 +221,12 @@ LLVM 19
187221
``_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES`` macros have been deprecated
188222
in LLVM 18 and will be removed entirely in LLVM 19.
189223

224+
- The macro ``_LIBCPP_INLINE_VISIBILITY`` has been deprecated in LLVM 18 and
225+
will be removed entirely in LLVM 19.
226+
227+
- The macro ``_VSTD`` has been deprecated in LLVM 18 and will be removed
228+
entirely in LLVM 19.
229+
190230
LLVM 20
191231
~~~~~~~
192232

@@ -203,12 +243,12 @@ ABI Affecting Changes
203243
- This release of libc++ added missing visibility annotations on some types in the library. Users compiling with
204244
``-fvisbility=hidden`` may notice that additional type infos from libc++ are being exported from their ABI. This is
205245
the correct behavior in almost all cases since exporting the RTTI is required for these types to work properly with
206-
dynamic_cast, exceptions and other mechanisms across binaries. However, if you intend to use libc++ purely as an
246+
``dynamic_cast``, exceptions and other mechanisms across binaries. However, if you intend to use libc++ purely as an
207247
internal implementation detail (i.e. you use libc++ as a static archive and never export libc++ symbols from your ABI)
208248
and you notice changes to your exported symbols list, then this means that you were not properly preventing libc++
209249
symbols from being part of your ABI.
210250

211-
- The name mangling for intantiations of ``std::projected`` has changed in order to implement P2538R1. This technically
251+
- The name mangling for instantiations of ``std::projected`` has changed in order to implement P2538R1. This technically
212252
results in an ABI break, however in practice we expect uses of ``std::projected`` in ABI-sensitive places to be
213253
extremely rare. Any error resulting from this change should result in a link-time error.
214254

@@ -219,18 +259,30 @@ ABI Affecting Changes
219259
to throw a different exception when attempting allocations that are too large
220260
(``std::bad_alloc`` vs ``std::length_error``).
221261

222-
- The layout of some views inside ``std::ranges`` that use the ``movable-box`` exposition-only type as an implementation
223-
detail has changed in order to fix a bug which could result in overwriting user data following the ``movable-box``
224-
<https://github.com/llvm/llvm-project/issues/70506>.
225-
This was caused by incorrect usage of the ``[[no_unique_address]]`` attribute inside the implementation of ``movable-box``.
226-
This only affects the layout of the following views: ``take_while_view``, ``filter_view``, ``single_view``, ``drop_while_view``,
227-
``repeat_view``, ``transform_view``, ``chunk_by_view``. In order to avoid silent breakage, an ABI tag has been added to
228-
these views such that their mangled name will be different starting in this version of libc++.
229-
As a result, attempting to call a function that expects one of these views will fail to link until the code has been rebuilt
230-
against a matching version of libc++. In practice, we believe it is unusual for these views to appear at ABI boundaries so this
231-
should not be a major problem for most users. However it is probably worth auditing ranges-heavy code for ABI boundaries that
262+
- The layout of some range adaptors that use the ``movable-box`` exposition-only type as an implementation
263+
detail has changed in order to fix a `bug <https://github.com/llvm/llvm-project/issues/70506>`_ which could result in
264+
overwriting user data following the ``movable-box``.
265+
This bug was caused by incorrect usage of the ``[[no_unique_address]]`` attribute inside the implementation of ``movable-box``.
266+
This fix affects the layout of the following views: ``take_while_view``, ``filter_view``, ``single_view``, ``drop_while_view``,
267+
``repeat_view``, ``transform_view``, ``chunk_by_view``. In order to avoid silent breakage as a result of this fix, an ABI tag has been added to
268+
these views such that their mangled name will be different starting in this version of libc++.
269+
As a result, attempting to call a function that expects one of these views will fail to link until the code has been rebuilt
270+
against a matching version of libc++. In practice, we believe it is unusual for these views to appear at ABI boundaries so this
271+
should not be a major problem for most users. However it is probably worth auditing ranges-heavy code for ABI boundaries that
232272
would contain these views, or for types that contain these views as members and which are passed across ABI boundaries.
233273

274+
- Some properties of libc++ may cause ODR-violations when mixing multiple libc++
275+
instances. To avoid these, often benign, ODR-violations the ODR-affecting
276+
properties are now part of the ABI tag. The ODR-affecting properties are:
277+
278+
- library version (This was part of the ABI tag prior to LLVM 18.)
279+
- exceptions vs no-exceptions
280+
- hardening mode
281+
282+
This should not be ABI-affecting except that libc++ will be more robust
283+
against different configurations of it being used in different translation
284+
units.
285+
234286
Build System Changes
235287
--------------------
236288

libcxx/docs/Status/Parallelism.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. parallelism-status:
1+
.. _parallelism-status:
22

33
====================================
44
libc++ Parallelism TS Status (N4808)

libcxx/docs/Status/Ranges.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. ranges-status:
1+
.. _ranges-status:
22

33
================================
44
libc++ Ranges Status

0 commit comments

Comments
 (0)