aboutsummaryrefslogtreecommitdiff
path: root/libcxx
AgeCommit message (Collapse)AuthorFilesLines
2023-04-19Bump version to 16.0.3Tom Stellard1-1/+1
2023-04-04Bump version to 16.0.2Tom Stellard1-1/+1
2023-04-04[libc++] Don't try to provide source_location on AppleClang 1403Louis Dionne7-14/+18
AppleClang 1403 has some bugs that prevent std::source_location from working properly on it. Consequently, we XFAILed the unit test for source_location with that compiler. However, we should also avoid advertising that the feature is supported on that compiler, otherwise our feature-test macros lie. This was noticed to break Boost.Asio when building with a recent libc++ and AppleClang 14.0.3. rdar://106863087 Differential Revision: https://reviews.llvm.org/D146837 (cherry picked from commit c2a42381c18edf0fedd0fc7e3c8541d4fa3e0bcc)
2023-04-03[libc++] Mark a test relying on `typeid` as unsupported without RTTI.Konstantin Varlamov1-0/+3
(cherry picked from commit f50cad2c55dfab4ff3da010a64119b4a93522289)
2023-04-03[release/16.x][libc++] Revert the bitset sort optimizationLouis Dionne2-432/+147
Part of the bitset sort optimization can cause code using an invalid comparator to go out-of-bounds, which is potentially dangerous. This was an unintended consequence of the original patch, or at least the fact that we didn't have anything in place to catch that or announce that to vendors was unintended. More specifically, std::sort assumes that the comparison predicate is a strict weak order (which is a pre-condition to the algorithm). However, in practice, some predicates may not satisfy the pre-condition in subtle ways. While that is technically a user problem, we need a good answer for how to handle this given that we know this exists in the wild and unconditionally reading out-of-bounds data is not a great answer. We can't weaken the preconditions of the algorithm, however letting this situation happen without even a way of diagnosing the issue is pretty bad. Hence, this patch reverts the optimization from release/16.x so that we can buy a bit of time to figure out how to properly handle and communicate this change in the LLVM 17 release. The bitset sort optimization was 4eddbf9f10a (aka https://llvm.org/D122780). This patch is not a pure revert of the patch, I also fixed up the includes a bit. Differential Revision: https://reviews.llvm.org/D146421
2023-04-03[libc++] Fix CI on release/16.xLouis Dionne11-9/+20
This patch is aimed directly at release/16.x -- it ensures that we can run the CI successfully on the release branch. It's a collection of changes that were made on main and not backported to release/16.x because the CI had been failing since we created the branch. Differential Revision: https://reviews.llvm.org/D147065
2023-03-28Bump version to 16.0.1Tobias Hieta1-1/+1
2023-03-28[libc++] Avoid ODR violations in __exception_guardNikolas Klauser5-26/+78
Having an ODR violation with `__exception_guard` seems to be problematic in LTO builds. To avoid the ODR violation, give the class different names for exception/no-exceptions mode and have an alias to the correct class. Reviewed By: ldionne, #libc, alexfh Spies: aeubanks, dblaikie, joanahalili, alexfh, rupprecht, libcxx-commits Differential Revision: https://reviews.llvm.org/D143071 (cherry picked from commit 1a17739d3aa78599c32f6106e05dcfa7f3f9e823)
2023-03-24[libc++][ranges] Fix incorrect integer typedef in `elements_view` test.Konstantin Varlamov1-1/+2
Differential Revision: https://reviews.llvm.org/D142951 (cherry picked from commit 3fe3f9c51cbac91af741e53e96c89f633bd2a6ad)
2023-03-24[libc++][format] Fix a missing include in tests.Konstantin Varlamov1-0/+1
(cherry picked from commit 78f17b2a98e9c7ce4a28c48955ef312157099a69)
2023-03-08[libc++][format] Fixes invalid usage of m type.Mark de Wever3-7/+6
The m type in a range formatter may only be used when a pair or a tuple with two elements is used. This was not correctly validated as reported in llvm.org/PR60995. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D145309 (cherry picked from commit 347a65a16493f00ee3eaeaeaf11d3611c62343eb)
2023-03-08[libc++][format] Fix floating point formatting.Mark de Wever2-2/+55
Fixes llvm.org/PR58714 reported by @jwakely and a similar issue reported privately by @vitaut. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D145306 (cherry picked from commit 5eaba4a9b1899ce16785b05854bddd39d54b0266)
2023-03-08[libc++] Fix ranges::binary_search() returning true for cases where the ↵Nikolas Klauser4-2/+41
element is not in the range Fixes #61160 Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D145287 (cherry picked from commit 33912468a7dbd2cdef3648878ccd6b8f99e0b5bf)
2023-03-06[libc++][NFC] update Range Status for the completion of C++20 rangesHui1-1/+1
Differential Revision: https://reviews.llvm.org/D142494 (cherry picked from commit c510c387631ee58ccba74d6ad0f375d2ab098bb2)
2023-03-06[libc++] Temporarily not use compiler intrinsics for some type traits in ↵Konstantin Varlamov4-4/+116
Objective-C++ mode. Currently, there are bugs in Clang's intrinsics for type traits when handling Objective-C++ `id` (e.g. in `add_pointer`). As a temporary workaround, don't use these intrinsics in the Objective-C++ mode. Differential Revision: https://reviews.llvm.org/D145186 (cherry picked from commit 87cf39aa349b83ae3b7d16c30ac7a8ffa0ad098c)
2023-03-06[libc++][ranges] move all range iterators back in classHui8-465/+448
move all range iterators back in class, as out of class iterators requires extra template parameters, which changes ADL Differential Revision: https://reviews.llvm.org/D143324 (cherry picked from commit 4c2ad195f8c9fe4e3f8a57502d5334d6cbc74f76)
2023-03-06[libcxx][ranges] revert join_view::iterator and sentinel to be in-classHui3-51/+67
(cherry picked from commit 3b059cd25b8ce31762b76a3b172fdd811c07dc34)
2023-02-28[libc++] Add FTM for views::as_rvalueNikolas Klauser5-0/+56
`views::as_rvalue` was implemented in D137637, but we forgot to set the feature test macro. Fixes #60986. Reviewed By: Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D144781 (cherry picked from commit 3d4b7a6fa8a45488c141a8640cd53980bdb868e5)
2023-02-14[libc++] Fix bug in allocate_shared_for_overwriteLouis Dionne5-57/+123
Instead of destroying the object with allocator::destroy, we must call its destructor directly. As a fly-by also mark LWG3008 as fixed since it is handled by our implementation. This was pointed out by Tim Song in https://reviews.llvm.org/D140913. Differential Revision: https://reviews.llvm.org/D143791 (cherry picked from commit 5801090258011cfe636cda1493ac9bc07fb2a889)
2023-02-14[libc++][NFC] Rename _LIBCPP_NO_RTTI to _LIBCPP_HAS_NO_RTTINikolas Klauser4-32/+32
Other macros that disable parts of the library are named `_LIBCPP_HAS_NO_WHATEVER`. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D143164 (cherry picked from commit cf65d275ac048dfb781c7302c6c82c3500184eb1)
2023-02-14[libc++] fix `shared_ptr`'s incorrect constraintsHui13-120/+290
Fix several bugs: 1. https://llvm.org/PR60258 The conversion constructors' constraint `__compatible_with` incorrectly allow array types conversion to scalar types 2. https://llvm.org/PR53368 The constructor that takes `unique_ptr` are not suffiently constrained. 3. The constructors that take raw pointers incorretly use `__compatible_with`. They have different constraints Differential Revision: https://reviews.llvm.org/D143346 (cherry picked from commit a38a4654ce4b1d2ae8a03797d2e520e415150492)
2023-02-14[libc++][NFC] Rename multidimentional uninitialized algorithmsNikolas Klauser2-17/+17
Reviewed By: Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D142526 (cherry picked from commit ba43f3e857390932fede4aedf3e57d8f3787e804)
2023-02-13[libc++] In tests, use `abort` to terminate upon an error.Konstantin Varlamov1-1/+1
Differential Revision: https://reviews.llvm.org/D143245 (cherry picked from commit 8e13ec9eca1fc758c213a94b563221e6afc5b031)
2023-02-10[libc++] Guard the fix to CityHash behind ABI v2Louis Dionne3-0/+17
As explained in a comment in https://reviews.llvm.org/D134124, we tried landing this unconditionally but this actually bit some users who were sharing std::unordered_map across an ABI boundary. This shows that the ABI break is not benign and it should be guarded behind ABI v2. Differential Revision: https://reviews.llvm.org/D143688 (cherry picked from commit 02718433a0dd3f8d3f3719b97aa1685b699ac785)
2023-02-07[libc++][format] Fixes constexpr validation.Mark de Wever2-3/+9
The constexpr validation parsed parts of the format string that didn't belong to the specific replacement field. Fixes https://llvm.org/PR60536 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D143402 (cherry picked from commit ac44dadcbea52e14aab20c0d590d4ec00d615a93)
2023-02-05[libc++] Remove use of internal glibc macros to determine if c8rtomb() and ↵Tom Honermann2-7/+17
mbrtoc8() are present. When support for declaring the c8rtomb() and mbrtoc8() functions within the std namespace was added in commit 7e7013c5d4b1b3996c8dba668c5a94bb33b2999b, internal glibc macros were used to determine if C2X extensions are enabled. Specifically, a check for whether `__GLIBC_USE` is defined and whether `__GLIBC_USE(ISOC2X)` is non-0 was added. `__GLIBC_USE` is an internal detail of the glibc implementation that may be changed or removed in the future potentially leading to inconsistency or compilation failures. This change removes the use of the internal glibc macro to avoid such problems. Unfortunately, without another mechanism to determine if C2X extensions are enabled, this removal will result in inconsistent declarations of the c8rtomb() and mbrtoc8() functions; when C++ char8_t support is not enabled, but C2X extensions are, these functions will be declared in the global namespace but not in the std namespace. This situation will improve when C23 support is finalized and the check can be re-implemented using `__STDC_VERSION__`. (cherry picked from commit cf93a3dd512e4912181f05790992c760378c8893)
2023-02-05[libc++] Fixes the Clang modular build.Mark de Wever1-3/+13
The patch 430b397f6715d4d2f2569716c93fcd6292ace3dc ("[libc++] Granularize <type_traits> includes in <iterator>") missed some exports in the modulemap with became apparent in the reverting commit 12cb1cb3720d. This fixes the issue by updating the modulemap. Note that the Clang ICE is not fixed by this change. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142690 (cherry picked from commit a7f8ddc4e2e3dac4c123ed8db1704f2753db5722)
2023-02-05[libc++][ranges] Temporarily mark `ranges::join_view` as experimental.varconst28-3/+35
This is in anticipation of https://isocpp.org/files/papers/D2770R0.html, which is ABI-breaking for `join_view`. Differential Revision: https://reviews.llvm.org/D142520 (cherry picked from commit c2b3986e39bc812806ef25684c57609798e00513)
2023-01-31[libc++][NFC] Update the libc++ release notes for LLVM 16.Konstantin Varlamov1-2/+13
Reviewed By: #libc, ldionne, tstellar Differential Revision: https://reviews.llvm.org/D142873
2023-01-27libcxx: Don't apply ABI tags to extern "C" fnsArsen Arsenović7-152/+67
GCC rejects ABI tags on non mangled functions, as they would otherwise be a no-op. This commit replaces such instances with equivalent _LIBCPP_HIDE_FROM_ABI constants but without ABI tags attached. .../include/c++/v1/__support/musl/xlocale.h:28:68: error: 'abi_tag' attribute applied to extern "C" declaration 'long long int strtoll_l(const char*, char**, int, locale_t)' 28 | strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) { | ^ Bug: https://bugs.gentoo.org/869038 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142415
2023-01-24[libc++] Introduce a compile-time mechanism to override __libcpp_verbose_abortLouis Dionne9-49/+87
This changes the mechanism for verbose termination (again!) to make it support compile-time customization in addition to link-time customization, which is important for users who need fine-grained control over what code gets generated around sites that call the verbose termination handler. This concern had been raised to me both privately by prospecting users and in https://llvm.org/D140944, so I think it is clearly worth fixing. We still support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED for a limited time since the same functionality can be achieved by overriding the _LIBCPP_VERBOSE_ABORT macro. Differential Revision: https://reviews.llvm.org/D141326
2023-01-25[NFC][libc++] Remove __unexpected namespaceyronglin2-18/+14
Remove __unexpected namespace. Reviewed By: philnik, #libc, ldionne Differential Revision: https://reviews.llvm.org/D141947
2023-01-24[libc++][format] Fixes usage of contiguous ranges.Mark de Wever2-2/+72
The contiguous range made incorrect assumptions for certain input ranges. Fixes llvm.org/PR60164 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142302
2023-01-24[libc++][doc] Updates format status.Mark de Wever5-4/+6
The paper - P2286R8 Formatting ranges is fully implemented modulo its feature test macro. This macro has been revised by - LWG3750 Too many papers bump __cpp_lib_format The new macro depends on - P2585R0 Improving default container formatting This paper revises parts of P2286R8 and adds new formatter specializations. The specialization for debug strings has some wording issues, which is addresses in this paper - P2733R0 Fix handling of empty specifiers in std::format Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142153
2023-01-24[libc++][ranges] implement `std::ranges::split_view`Hui30-3/+2246
- implement `std::ranges::split_view` (last c++20 view) - Work in process on testing iterator/sentinel, but since we are getting closer to the deadline, I'd like to send the review early Differential Revision: https://reviews.llvm.org/D142063
2023-01-23[libc++] Fix installation path for the modulemapLouis Dionne1-2/+7
As pointed out in a post-commit comment of https://reviews.llvm.org/rGd00e035a4270. Differential Revision: https://reviews.llvm.org/D142365
2023-01-23[libc++] implement P1020R1 P1973R1 make_unique[shared]_for_overwriteHui11-14/+666
Differential Revision: https://reviews.llvm.org/D140913
2023-01-23[libc++][doc] Fixes the usage of improper markup.Mark de Wever2-3/+3
2023-01-23[libc++] Refactor clang-query checks to clang-tidy checks to get less ↵Nikolas Klauser14-358/+148
obscure error messages Also remove clang-query related code, since it's unused now. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D141805
2023-01-23[libc++] Improve binary size when using __transactionNikolas Klauser13-161/+231
__exception_guard is a no-op in -fno-exceptions mode to produce better code-gen. This means that we don't provide the strong exception guarantees. However, Clang doesn't generate cleanup code with exceptions disabled, so even if we wanted to provide the strong exception guarantees we couldn't. This is also only relevant for constructs with a stack of -fexceptions > -fno-exceptions > -fexceptions code, since the exception can't be caught where exceptions are disabled. While -fexceptions > -fno-exceptions is quite common (e.g. libc++.dylib > -fno-exceptions), having another layer with exceptions enabled seems a lot less common, especially one that tries to catch an exception through -fno-exceptions code. Fixes https://github.com/llvm/llvm-project/issues/56783 Reviewed By: ldionne, Mordante, huixie90, #libc Spies: EricWF, alexfh, hans, joanahalili, libcxx-commits Differential Revision: https://reviews.llvm.org/D133661
2023-01-22[NFC] Fix "form/from" typosPiotr Fusik2-2/+2
Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142007
2023-01-22[libc++][test] Disable parts requiring locales.Mark de Wever3-0/+9
This part should be guarded, but there are no proper guards yet. Therefore disable the offending part. This was reported post commit in D140653.
2023-01-22[libc++] Rename take_while_view::__sentinel to __take_while_view_sentinelNikolas Klauser1-12/+18
This makes it easier to specialize traits classes, like __segmented_iterator_traits. Reviewed By: var-const, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D142276
2023-01-21[libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine>Nikolas Klauser9-10/+22
`<coroutine>` seems to be new enough to not be a huge problem. Reviewed By: Mordante, #libc Spies: libcxx-commits, ChuanqiXu Differential Revision: https://reviews.llvm.org/D140600
2023-01-21[libc++] Implement P1413R3 (Deprecate std::aligned_storage and ↵Nikolas Klauser17-14/+79
std::aligned_union) There are no tests for the aliases because clang doesn't diagnose deprecated template aliases currently. Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D127678
2023-01-20[libc++] Add FreeBSD XFAILs in preparation for CIEd Maste39-1/+74
This at least allows us to stand up libc++ FreeBSD CI and avoid future regressions. The failures do need to be addressed, and can be done iteratively. Reviewed By: philnik, Mordante Differential Revision: https://reviews.llvm.org/D141542
2023-01-20[libc++] add FreeBSD atomic wait supportKonstantin Belousov1-0/+21
Reviewed By: philnik Differential Revision: https://reviews.llvm.org/D142134
2023-01-20[libc++][format] range-default-formatter for set.Mark de Wever8-6/+1773
Implements the range-default-formatter specialization range_format::set. Implements parts of - P2286R8 Formatting Ranges - P2585R0 Improving default container formatting Depends on D140801 Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D141195
2023-01-20[libc++] Move iota_view::iterator and sentinel out of iota_viewNikolas Klauser2-205/+229
This makes it a lot easier to specialize traits types for it, like __segmented_iterator_traits. Reviewed By: var-const, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D141454
2023-01-20[libc++] Enable clang-tidy from the buildkite pipeline instead of ↵Nikolas Klauser2-12/+20
hard-coding it in run-buildbot Reviewed By: ldionne, #libc, Mordante, emaste Spies: emaste, Mordante, libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D141294