2019-07-18 19:51:05 +08:00
|
|
|
=========================================
|
2020-07-15 17:40:53 +08:00
|
|
|
Libc++ 12.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::
|
|
|
|
|
2020-07-15 17:40:53 +08:00
|
|
|
These are in-progress notes for the upcoming libc++ 12 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,
|
2020-07-15 17:40:53 +08:00
|
|
|
part of the LLVM Compiler Infrastructure, release 12.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
|
|
|
|
2020-07-15 17:40:53 +08:00
|
|
|
What's New in Libc++ 12.0.0?
|
2019-07-18 19:51:05 +08:00
|
|
|
============================
|
2018-09-06 22:46:22 +08:00
|
|
|
|
|
|
|
New Features
|
|
|
|
------------
|
2021-01-23 02:03:14 +08:00
|
|
|
- Random device support has been made optional. It's enabled by default and can
|
|
|
|
be disabled by building libc++ with ``-DLIBCXX_ENABLE_RANDOM_DEVICE=OFF``.
|
|
|
|
Disabling random device support can be useful when building the library for
|
|
|
|
platforms that don't have a source of randomness, such as some embedded
|
|
|
|
platforms. When this is not supported, most of ``<random>`` will still be
|
|
|
|
available, but ``std::random_device`` will not.
|
|
|
|
- Localization support has been made optional. It's enabled by default and can
|
|
|
|
be disabled by building libc++ with ``-DLIBCXX_ENABLE_LOCALIZATION=OFF``.
|
|
|
|
Disabling localization can be useful when porting to platforms that don't
|
|
|
|
support the C locale API (e.g. embedded). When localization is not
|
|
|
|
supported, several parts of the library will be disabled: ``<iostream>``,
|
|
|
|
``<regex>``, ``<locale>`` will be completely unusable, and other parts may be
|
|
|
|
only partly available.
|
|
|
|
- If libc++ is compiled with a C++20 capable compiler it will be compiled in
|
|
|
|
C++20 mode. Else libc++ will be compiled in C++17 mode.
|
|
|
|
- Several unqualified lookups in libc++ have been changed to qualified lookups.
|
|
|
|
This makes libc++ more ADL-proof.
|
|
|
|
- The libc++ implementation status pages have been overhauled. Like other parts
|
|
|
|
documentation they now use restructured text instead of html. Starting with
|
|
|
|
libc++12 the status pages are part of libc++'s documentation.
|
|
|
|
- More C++20 features have been implemented. :doc:`Cxx2aStatus` has the full
|
|
|
|
overview of libc++'s C++20 implementation status.
|
|
|
|
- Work has started to implement new C++2b features. :doc:`Cxx2bStatus` has the
|
|
|
|
full overview of libc++'s C++2b implementation status.
|
2018-09-06 22:46:22 +08:00
|
|
|
|
2020-06-19 15:13:33 +08:00
|
|
|
|
2018-09-06 22:46:22 +08:00
|
|
|
API Changes
|
|
|
|
-----------
|
[libc++] Define new/delete in libc++abi only by default
Previously, we would define new/delete in both libc++ and libc++abi.
Not only does this cause code bloat, but also it's technically an ODR
violation since we don't know which operator will be selected. Furthermore,
since those are weak definitions, we should strive to have as few of them
as possible (to improve load times).
My preferred choice would have been to put the operators in libc++ only
by default, however that would create a circular dependency between
libc++ and libc++abi, which GNU linkers don't handle.
Folks who want to ship new/delete in libc++ instead of libc++abi are
free to do so by turning on LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS at
CMake configure time.
On Apple platforms, this shouldn't be an ABI break because we re-export
the new/delete symbols from libc++abi. This change actually makes libc++
behave closer to the system libc++ shipped on Apple platforms.
On other platforms, this is an ABI break for people linking against libc++
but not libc++abi. However, vendors have been consulted in D68269 and no
objection was raised. Furthermore, the definitions can be controlled to
appear in libc++ instead with the CMake option.
Differential Revision: https://reviews.llvm.org/D68269
2019-10-01 21:34:58 +08:00
|
|
|
- By default, libc++ will _not_ include the definition for new and delete,
|
|
|
|
since those are provided in libc++abi. Vendors wishing to provide new and
|
|
|
|
delete in libc++ can build the library with ``-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON``
|
|
|
|
to get back the old behavior. This was done to avoid providing new and delete
|
|
|
|
in both libc++ and libc++abi, which is technically an ODR violation. Also
|
|
|
|
note that we couldn't decide to put the operators in libc++ only, because
|
|
|
|
they are needed from libc++abi (which would create a circular dependency).
|
2020-11-24 21:50:49 +08:00
|
|
|
- During the C++20 standardization process some new low-level bit functions
|
|
|
|
have been renamed. Libc++ has renamed these functions to match the C++20
|
|
|
|
Standard.
|
|
|
|
- ``ispow2`` has been renamed to ``has_single_bit``
|
|
|
|
- ``ceil2`` has been renamed to ``bit_ceil``
|
|
|
|
- ``floor2`` has been renamed to ``bit_floor``
|
|
|
|
- ``log2p1`` has been renamed to ``bit_width``
|
2020-10-26 19:18:46 +08:00
|
|
|
|
|
|
|
- In C++20 mode, ``std::filesystem::path::u8string()`` and
|
|
|
|
``generic_u8string()`` now return ``std::u8string`` according to P0428,
|
|
|
|
while they return ``std::string`` in C++17. This can cause source
|
|
|
|
incompatibility, which is discussed and acknowledged in P1423, but that
|
|
|
|
paper doesn't suggest any remediation for this incompatibility.
|