2024-01-25 13:36:50 -05:00
|
|
|
===========================================
|
|
|
|
Libc++ 19.0.0 (In-Progress) Release Notes
|
|
|
|
===========================================
|
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
:depth: 2
|
|
|
|
|
|
|
|
Written by the `Libc++ Team <https://libcxx.llvm.org>`_
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
These are in-progress notes for the upcoming libc++ 19.0.0 release.
|
|
|
|
Release notes for previous releases can be found on
|
|
|
|
`the Download Page <https://releases.llvm.org/download.html>`_.
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document contains the release notes for the libc++ C++ Standard Library,
|
|
|
|
part of the LLVM Compiler Infrastructure, release 19.0.0. Here we describe the
|
|
|
|
status of libc++ in some detail, including major improvements from the previous
|
|
|
|
release and new feature work. For the general LLVM release notes, see `the LLVM
|
|
|
|
documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM releases may
|
|
|
|
be downloaded from the `LLVM releases web site <https://llvm.org/releases/>`_.
|
|
|
|
|
|
|
|
For more information about libc++, please see the `Libc++ Web Site
|
|
|
|
<https://libcxx.llvm.org>`_ or the `LLVM Web Site <https://llvm.org>`_.
|
|
|
|
|
|
|
|
Note that if you are reading this file from a Git checkout or the
|
|
|
|
main Libc++ web page, this document applies to the *next* release, not
|
|
|
|
the current one. To see the release notes for a specific release, please
|
|
|
|
see the `releases page <https://llvm.org/releases/>`_.
|
|
|
|
|
|
|
|
What's New in Libc++ 19.0.0?
|
|
|
|
==============================
|
|
|
|
|
|
|
|
Implemented Papers
|
|
|
|
------------------
|
2024-02-01 13:31:25 +02:00
|
|
|
|
2024-01-29 14:33:27 -05:00
|
|
|
- P2637R3 - Member ``visit``
|
2024-02-01 13:31:25 +02:00
|
|
|
- P2652R2 - Disallow User Specialization of ``allocator_traits``
|
2024-02-19 09:56:06 +02:00
|
|
|
- P2819R2 - Add ``tuple`` protocol to ``complex``
|
2024-03-06 14:09:26 +02:00
|
|
|
- P2495R3 - Interfacing ``stringstream``\s with ``string_view``
|
2024-04-04 06:03:00 +03:00
|
|
|
- P2867R2 - Remove Deprecated ``strstream``\s From C++26
|
2024-04-05 22:04:07 +03:00
|
|
|
- P2872R3 - Remove ``wstring_convert`` From C++26
|
2024-04-06 21:52:52 +03:00
|
|
|
- P3142R0 - Printing Blank Lines with ``println`` (as DR against C++23)
|
2024-05-09 12:48:37 +03:00
|
|
|
- P2944R3 - Comparisons for ``reference_wrapper`` (comparison operators for ``reference_wrapper`` only)
|
2024-02-29 16:06:32 -08:00
|
|
|
- P2302R4 - ``std::ranges::contains``
|
|
|
|
- P1659R3 - ``std::ranges::starts_with`` and ``std::ranges::ends_with``
|
2024-04-12 13:25:22 -04:00
|
|
|
- P3029R1 - Better ``mdspan``'s CTAD
|
2024-04-23 10:58:14 -04:00
|
|
|
- P2387R3 - Pipe support for user-defined range adaptors
|
2024-04-25 17:16:41 +02:00
|
|
|
- P2713R1 - Escaping improvements in ``std::format``
|
2024-05-10 15:13:00 +01:00
|
|
|
- P2231R1 - Missing ``constexpr`` in ``std::optional`` and ``std::variant``
|
2024-05-21 18:54:08 -04:00
|
|
|
- P0019R8 - ``std::atomic_ref``
|
2024-01-25 13:36:50 -05:00
|
|
|
|
|
|
|
Improvements and New Features
|
|
|
|
-----------------------------
|
|
|
|
|
2024-02-04 00:28:29 +01:00
|
|
|
- The performance of growing ``std::vector`` has been improved for trivially relocatable types.
|
2024-06-17 13:09:04 +02:00
|
|
|
- A lot of types are considered trivially relocatable now, including ``vector`` and ``string``.
|
2024-03-17 20:00:54 +01:00
|
|
|
- The performance of ``ranges::fill`` and ``ranges::fill_n`` has been improved for ``vector<bool>::iterator``\s,
|
|
|
|
resulting in a performance increase of up to 1400x.
|
2024-03-23 15:28:22 +01:00
|
|
|
- The ``std::mismatch`` algorithm has been optimized for integral types, which can lead up to 40x performance
|
|
|
|
improvements.
|
2024-04-09 19:20:06 +02:00
|
|
|
|
2024-04-06 17:22:07 +02:00
|
|
|
- The ``std::ranges::minmax`` algorithm has been optimized for integral types, resulting in a performance increase of
|
|
|
|
up to 100x.
|
2024-01-25 13:36:50 -05:00
|
|
|
|
2024-04-04 06:03:00 +03:00
|
|
|
- The ``_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM`` macro has been added to make the declarations in ``<strstream>`` available.
|
|
|
|
|
2024-04-05 22:04:07 +03:00
|
|
|
- The ``_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT`` macro has been added to make the declarations in ``<locale>``
|
|
|
|
available.
|
|
|
|
|
2024-04-09 19:20:06 +02:00
|
|
|
- The formatting library is updated to Unicode 15.1.0.
|
|
|
|
|
2024-01-25 13:36:50 -05:00
|
|
|
Deprecations and Removals
|
|
|
|
-------------------------
|
|
|
|
|
2024-04-16 10:57:48 -04:00
|
|
|
- The C++20 synchronization library (``<barrier>``, ``<latch>``, ``atomic::wait``, etc.) has been deprecated
|
|
|
|
in language modes prior to C++20. If you are using these features prior to C++20, please update to ``-std=c++20``.
|
|
|
|
In LLVM 20, the C++20 synchronization library will be removed entirely in language modes prior to C++20.
|
|
|
|
|
2024-04-22 22:13:58 +02:00
|
|
|
- ``_LIBCPP_DISABLE_NODISCARD_EXT`` has been removed. ``[[nodiscard]]`` applications are now unconditional.
|
|
|
|
This decision is based on LEWGs discussion on `P3122 <https://wg21.link/P3122>` and `P3162 <https://wg21.link/P3162>`
|
|
|
|
to not use ``[[nodiscard]]`` in the standard.
|
|
|
|
|
2024-01-25 13:36:50 -05:00
|
|
|
- TODO: The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable that was used to enable the safe mode has been deprecated and setting
|
|
|
|
it triggers an error; use the ``LIBCXX_HARDENING_MODE`` CMake variable with the value ``extensive`` instead. Similarly,
|
|
|
|
the ``_LIBCPP_ENABLE_ASSERTIONS`` macro has been deprecated (setting it to ``1`` still enables the extensive mode in
|
|
|
|
the LLVM 19 release while also issuing a deprecation warning). See :ref:`the hardening documentation
|
|
|
|
<using-hardening-modes>` for more details.
|
|
|
|
|
[libc++] Remove deprecated char_traits base template (#72694)
This patch has quite a bit of history. First, it must be noted that the
Standard only specifies specializations of char_traits for char,
char8_t, char16_t, char32_t and wchar_t. However, before this patch, we
would provide a base template that accepted anything, and as a result
code like `std::basic_string<long long>` would compile but nobody knows
what it really does. It basically compiles by accident.
We marked the base template as deprecated in LLVM 15 or 16 and were
planning on removing it in LLVM 17, which we did in e30a148b098d.
However, it turned out that the deprecation warning had never been
visible in user code since Clang did not surface that warning from
system headers. As a result, this caught people by surprise and we
decided to reintroduce the base template in LLVM 17 in cce062d226ba.
Since then, #70353 changed Clang so that such deprecation warnings would
be visible from user code. Hence, this patch closes the loop and removes
the deprecated specializations.
2024-01-30 08:45:28 -05:00
|
|
|
- The base template for ``std::char_traits`` has been removed in LLVM 19. If you are using ``std::char_traits`` with
|
2024-01-25 13:36:50 -05:00
|
|
|
types other than ``char``, ``wchar_t``, ``char8_t``, ``char16_t``, ``char32_t`` or a custom character type for which you
|
|
|
|
specialized ``std::char_traits``, your code will stop working. The Standard does not mandate that a base template is
|
|
|
|
provided, and such a base template is bound to be incorrect for some types, which could currently cause unexpected behavior
|
|
|
|
while going undetected.
|
|
|
|
|
2024-03-13 09:00:53 -04:00
|
|
|
- The ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`` macro that changed the behavior for narrowing conversions
|
2024-01-25 13:36:50 -05:00
|
|
|
in ``std::variant`` has been removed in LLVM 19.
|
|
|
|
|
2024-03-21 17:48:13 +01:00
|
|
|
- The ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS`` and ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION``
|
|
|
|
macros have been removed in LLVM 19.
|
2024-01-25 13:36:50 -05:00
|
|
|
|
2024-04-16 20:20:37 +02:00
|
|
|
- The ``_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES`` and ``_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES`` macros have
|
2024-01-25 13:36:50 -05:00
|
|
|
been removed in LLVM 19. C++17 and C++20 removed features can still be re-enabled individually.
|
|
|
|
|
2024-01-30 07:51:20 -05:00
|
|
|
- The ``_LIBCPP_INLINE_VISIBILITY`` and ``_VSTD`` macros have been removed in LLVM 19.
|
2024-01-25 13:36:50 -05:00
|
|
|
|
2024-02-27 17:31:02 -05:00
|
|
|
- The ``_LIBCPP_ATOMIC_ONLY_USE_BUILTINS`` configuration option has been removed in LLVM 19. This should not affect
|
|
|
|
many users, except perhaps users using the library with ``-ffreestanding`` with a toolchain where compiler-rt or
|
|
|
|
libatomic is not available. If you are one such user, please reach out to the libc++ developers so we can collaborate
|
|
|
|
on a path for supporting atomics properly on freestanding platforms.
|
|
|
|
|
2024-04-06 20:33:41 +08:00
|
|
|
- LWG3430 disallow implicit conversion of the source arguments to ``std::filesystem::path`` when
|
|
|
|
constructing ``std::basic_*fstream``. This effectively removes the possibility to directly construct
|
|
|
|
a ``std::basic_*fstream`` from a ``std::basic_string_view``, a input-iterator or a C-string, instead
|
|
|
|
you can construct a temporary ``std::basic_string``. This change has been applied to C++17 and later.
|
|
|
|
|
2024-05-01 10:26:38 -06:00
|
|
|
- The ``_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS`` macro has been removed and is not honored anymore. Additional
|
|
|
|
warnings provided by libc++ as a matter of QoI will now be provided unconditionally.
|
|
|
|
|
2024-06-25 09:19:55 -05:00
|
|
|
- libc++ no longer supports ``std::allocator<const T>`` and containers of ``const``-qualified element type, such
|
|
|
|
as ``std::vector<const T>`` and ``std::list<const T>``. This used to be supported as an undocumented extension.
|
|
|
|
If you were using ``std::vector<const T>``, replace it with ``std::vector<T>`` instead. The
|
|
|
|
``_LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST`` macro can be defined to temporarily re-enable this extension as
|
|
|
|
folks transition their code. This macro will be honored for one released and ignored starting in LLVM 20.
|
|
|
|
To assist with the clean-up process, consider running your code through Clang Tidy, with
|
|
|
|
`std-allocator-const <https://clang.llvm.org/extra/clang-tidy/checks/portability/std-allocator-const.html>`
|
|
|
|
enabled.
|
|
|
|
|
2024-03-18 16:53:37 +01:00
|
|
|
|
2024-01-25 13:36:50 -05:00
|
|
|
Upcoming Deprecations and Removals
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
LLVM 20
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
- The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable and the ``_LIBCPP_ENABLE_ASSERTIONS`` macro that were used to enable
|
|
|
|
the safe mode will be removed in LLVM 20.
|
|
|
|
|
|
|
|
LLVM 21
|
|
|
|
~~~~~~~
|
|
|
|
TODO
|
|
|
|
|
|
|
|
|
|
|
|
ABI Affecting Changes
|
|
|
|
---------------------
|
2024-04-09 19:13:02 +02:00
|
|
|
|
|
|
|
- The optional POSIX macro ``ENODATA`` has been deprecated in C++ and POSIX 2017. The
|
|
|
|
``random_device`` could throw a ``system_error`` with this value. It now
|
|
|
|
throws ``ENOMSG``.
|
2024-01-25 13:36:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
Build System Changes
|
|
|
|
--------------------
|
|
|
|
|
2024-02-26 14:46:15 -05:00
|
|
|
- The ``LIBCXX_EXECUTOR`` and ``LIBCXXABI_EXECUTOR`` CMake variables have been removed. Please
|
|
|
|
set ``LIBCXX_TEST_PARAMS`` to ``executor=<...>`` instead.
|
2024-04-13 12:32:46 +02:00
|
|
|
|
|
|
|
- The Cmake variable ``LIBCXX_ENABLE_CLANG_TIDY`` has been removed. The build system has been changed
|
|
|
|
to automatically detect the presence of ``clang-tidy`` and the required ``Clang`` libraries.
|
2024-04-28 14:12:27 +02:00
|
|
|
|
|
|
|
- The CMake options ``LIBCXX_INSTALL_MODULES`` now defaults to ``ON``.
|