@@ -35,9 +35,26 @@ see the `releases page <https://llvm.org/releases/>`_.
35
35
What's New in Libc++ 18.0.0?
36
36
==============================
37
37
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
+
41
58
42
59
Implemented Papers
43
60
------------------
@@ -68,8 +85,9 @@ Implemented Papers
68
85
Improvements and New Features
69
86
-----------------------------
70
87
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.
73
91
74
92
- ``std::for_each `` has been optimized for segmented iterators like ``std::deque::iterator `` in C++23 and
75
93
later, which can lead up to 40x performance improvements.
@@ -106,6 +124,11 @@ Improvements and New Features
106
124
``-DLIBCXX_INSTALL_MODULE_DIR=<path> ``. The default location is
107
125
``${PREFIX}/share/libc++/v1 ``.
108
126
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.
109
132
110
133
Deprecations and Removals
111
134
-------------------------
@@ -118,7 +141,7 @@ Deprecations and Removals
118
141
- The non-conforming constructor ``std::future_error(std::error_code) `` has been removed. Please use the
119
142
``std::future_error(std::future_errc) `` constructor provided in C++17 instead.
120
143
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
122
145
narrowing conversions in ``std::variant `` behaving in a non-standard way. This may change how some uses of
123
146
``std::variant ``'s constructor behave in user code. The ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT ``
124
147
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
155
178
that were removed in the C++17 and C++20 standards. Instead of using these
156
179
macros, please use the macros to re-enable individual features.
157
180
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
+
158
189
Upcoming Deprecations and Removals
159
190
----------------------------------
160
191
@@ -163,6 +194,9 @@ Upcoming Deprecations and Removals
163
194
LLVM 19
164
195
~~~~~~~
165
196
197
+ - The ``LIBCXX_EXECUTOR `` CMake variable has been deprecated. LLVM 19 will
198
+ completely remove support for the ``*_EXECUTOR `` variables.
199
+
166
200
- The ``LIBCXX_ENABLE_ASSERTIONS `` CMake variable that was used to enable the safe mode will be deprecated and setting
167
201
it will trigger an error; use the ``LIBCXX_HARDENING_MODE `` variable with the value ``extensive `` instead. Similarly,
168
202
the ``_LIBCPP_ENABLE_ASSERTIONS `` macro will be deprecated (setting it to ``1 `` still enables the extensive mode in
@@ -187,6 +221,12 @@ LLVM 19
187
221
``_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES `` macros have been deprecated
188
222
in LLVM 18 and will be removed entirely in LLVM 19.
189
223
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
+
190
230
LLVM 20
191
231
~~~~~~~
192
232
@@ -203,12 +243,12 @@ ABI Affecting Changes
203
243
- This release of libc++ added missing visibility annotations on some types in the library. Users compiling with
204
244
``-fvisbility=hidden `` may notice that additional type infos from libc++ are being exported from their ABI. This is
205
245
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
207
247
internal implementation detail (i.e. you use libc++ as a static archive and never export libc++ symbols from your ABI)
208
248
and you notice changes to your exported symbols list, then this means that you were not properly preventing libc++
209
249
symbols from being part of your ABI.
210
250
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
212
252
results in an ABI break, however in practice we expect uses of ``std::projected `` in ABI-sensitive places to be
213
253
extremely rare. Any error resulting from this change should result in a link-time error.
214
254
@@ -219,18 +259,30 @@ ABI Affecting Changes
219
259
to throw a different exception when attempting allocations that are too large
220
260
(``std::bad_alloc `` vs ``std::length_error ``).
221
261
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
232
272
would contain these views, or for types that contain these views as members and which are passed across ABI boundaries.
233
273
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
+
234
286
Build System Changes
235
287
--------------------
236
288
0 commit comments