2019-07-18 19:51:05 +08:00
|
|
|
=========================================
|
2022-07-27 10:43:55 +08:00
|
|
|
Libc++ 16.0.0 (In-Progress) Release Notes
|
2019-07-18 19:51:05 +08:00
|
|
|
=========================================
|
2018-09-06 22:46:22 +08:00
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
:depth: 2
|
|
|
|
|
2018-09-10 16:57:12 +08:00
|
|
|
Written by the `Libc++ Team <https://libcxx.llvm.org>`_
|
2018-09-06 22:46:22 +08:00
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
2022-07-27 10:43:55 +08:00
|
|
|
These are in-progress notes for the upcoming libc++ 16 release.
|
2018-09-06 22:46:22 +08:00
|
|
|
Release notes for previous releases can be found on
|
2018-09-10 16:57:12 +08:00
|
|
|
`the Download Page <https://releases.llvm.org/download.html>`_.
|
2018-09-06 22:46:22 +08:00
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document contains the release notes for the libc++ C++ Standard Library,
|
2022-07-27 10:43:55 +08:00
|
|
|
part of the LLVM Compiler Infrastructure, release 16.0.0. Here we describe the
|
2018-09-06 22:46:22 +08:00
|
|
|
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
|
2018-09-10 16:57:12 +08:00
|
|
|
documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM releases may
|
|
|
|
be downloaded from the `LLVM releases web site <https://llvm.org/releases/>`_.
|
2018-09-06 22:46:22 +08:00
|
|
|
|
|
|
|
For more information about libc++, please see the `Libc++ Web Site
|
2018-09-10 16:57:12 +08:00
|
|
|
<https://libcxx.llvm.org>`_ or the `LLVM Web Site <https://llvm.org>`_.
|
2018-09-06 22:46:22 +08:00
|
|
|
|
2020-01-15 17:02:56 +08:00
|
|
|
Note that if you are reading this file from a Git checkout or the
|
2018-09-06 22:46:22 +08:00
|
|
|
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
|
2018-09-10 16:57:12 +08:00
|
|
|
see the `releases page <https://llvm.org/releases/>`_.
|
2018-09-06 22:46:22 +08:00
|
|
|
|
2022-07-27 10:43:55 +08:00
|
|
|
What's New in Libc++ 16.0.0?
|
2019-07-18 19:51:05 +08:00
|
|
|
============================
|
2018-09-06 22:46:22 +08:00
|
|
|
|
2022-06-18 02:20:48 +08:00
|
|
|
Implemented Papers
|
|
|
|
------------------
|
2022-08-02 18:46:31 +08:00
|
|
|
- P2499R0 - ``string_view`` range constructor should be ``explicit``
|
2022-08-13 19:52:35 +08:00
|
|
|
- P2417R2 - A more constexpr bitset
|
2022-08-21 23:21:08 +08:00
|
|
|
- P2445R1 - ``std::forward_like``
|
2022-09-03 19:49:50 +08:00
|
|
|
- P2273R3 - Making ``std::unique_ptr`` constexpr
|
2022-02-15 01:26:02 +08:00
|
|
|
|
2022-07-22 00:48:14 +08:00
|
|
|
Improvements and New Features
|
|
|
|
-----------------------------
|
2022-09-10 22:16:20 +08:00
|
|
|
- Declarations of ``std::c8rtomb()`` and ``std::mbrtoc8()`` from P0482R6 are
|
|
|
|
now provided when implementations in the global namespace are provided by
|
|
|
|
the C library.
|
2022-06-18 02:20:48 +08:00
|
|
|
|
2022-07-22 00:48:14 +08:00
|
|
|
Deprecations and Removals
|
|
|
|
-------------------------
|
2022-08-20 16:34:26 +08:00
|
|
|
- Several incidental transitive includes have been removed from libc++. Those
|
|
|
|
includes are removed based on the language version used. Incidental transitive
|
|
|
|
inclusions of the following headers have been removed:
|
|
|
|
|
|
|
|
- C++20: ``chrono``
|
|
|
|
- C++2b: ``algorithm``, ``array``, ``atomic``, ``bit``, ``chrono``,
|
2022-09-03 19:37:09 +08:00
|
|
|
``climits``, ``cmath``, ``compare``, ``concepts``, ``cstdarg`, ``cstddef``,
|
|
|
|
``cstdint``, ``cstdlib``, ``cstring``, ``ctime``, ``exception``,
|
|
|
|
``functional``, ``initializer_list``, ``iosfwd``, ``iterator``, ``limits``,
|
|
|
|
``memory``, ``new``, ``numeric``, ``optional``, ``ratio``, ``stdexcept``,
|
|
|
|
``string``, ``tuple``, ``type_traits``, ``typeinfo``, ``unordered_map``,
|
|
|
|
``utility``, ``variant``, ``vector``.
|
2022-08-20 16:34:26 +08:00
|
|
|
|
|
|
|
Users can also remove all incidental transitive includes by defining
|
|
|
|
``_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`` regardless of the language version
|
|
|
|
in use. Note that in the future, libc++ reserves the right to remove
|
|
|
|
incidental transitive includes more aggressively, in particular regardless
|
|
|
|
of the language version in use.
|
|
|
|
|
2022-03-07 22:00:17 +08:00
|
|
|
|
2022-07-22 00:48:14 +08:00
|
|
|
Upcoming Deprecations and Removals
|
|
|
|
----------------------------------
|
|
|
|
|
2022-08-01 07:12:42 +08:00
|
|
|
API Changes
|
|
|
|
-----------
|
|
|
|
- The comparison operators on ``thread::id`` are now defined as free-standing
|
|
|
|
functions instead of as hidden friends, in conformance with the C++ standard.
|
|
|
|
Also see `issue 56187 <https://github.com/llvm/llvm-project/issues/56187>`_.
|
|
|
|
|
2022-08-19 21:41:56 +08:00
|
|
|
- ``_LIBCPP_ENABLE_NODISCARD`` and ``_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17`` are no longer respected.
|
|
|
|
Any standards-required ``[[nodiscard]]`` applications in C++20 are now always enabled. Any extended applications
|
2022-09-01 18:02:58 +08:00
|
|
|
are now enabled by default and can be disabled by defining ``_LIBCPP_DISABLE_NODISCARD_EXT``.
|
2022-08-19 21:41:56 +08:00
|
|
|
|
2022-07-22 00:48:14 +08:00
|
|
|
ABI Affecting Changes
|
|
|
|
---------------------
|
[libc++] Always query the compiler to find whether a type is always lockfree
In https://llvm.org/D56913, we added an emulation for the __atomic_always_lock_free
compiler builtin when compiling in Freestanding mode. However, the emulation
did (and could not) give exactly the same answer as the compiler builtin,
which led to a potential ABI break for e.g. enum classes.
After speaking to the original author of D56913, we agree that the correct
behavior is to instead always use the compiler builtin, since that provides
a more accurate answer, and __atomic_always_lock_free is a purely front-end
builtin which doesn't require any runtime support. Furthermore, it is
available regardless of the Standard mode (see https://godbolt.org/z/cazf3ssYY).
However, this patch does constitute an ABI break. As shown by https://godbolt.org/z/1eoex6zdK:
- In LLVM <= 11.0.1, an atomic<enum class with 1 byte> would not contain a lock byte.
- In LLVM >= 12.0.0, an atomic<enum class with 1 byte> would contain a lock byte.
This patch breaks the ABI again to bring it back to 1 byte, which seems
like the correct thing to do.
Fixes #57440
Differential Revision: https://reviews.llvm.org/D133377
2022-09-07 05:07:18 +08:00
|
|
|
- In freestanding mode, ``atomic<small enum class>`` does not contain a lock byte anymore if the platform
|
|
|
|
can implement lockfree atomics for that size. More specifically, in LLVM <= 11.0.1, an ``atomic<small enum class>``
|
|
|
|
would not contain a lock byte. This was broken in LLVM >= 12.0.0, where it started including a lock byte despite
|
|
|
|
the platform supporting lockfree atomics for that size. Starting in LLVM 15.0.1, the ABI for these types has been
|
|
|
|
restored to what it used to be (no lock byte), which is the most efficient implementation.
|
|
|
|
|
|
|
|
This ABI break only affects users that compile with ``-ffreestanding``, and only for ``atomic<T>`` where ``T``
|
|
|
|
is a non-builtin type that could be lockfree on the platform. See https://llvm.org/D133377 for more details.
|
2021-10-29 03:38:02 +08:00
|
|
|
|
2021-10-19 01:58:31 +08:00
|
|
|
Build System Changes
|
|
|
|
--------------------
|