Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
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)
|
|
(cherry picked from commit f50cad2c55dfab4ff3da010a64119b4a93522289)
|
|
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
|
|
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
|
|
|
|
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)
|
|
Differential Revision: https://reviews.llvm.org/D142951
(cherry picked from commit 3fe3f9c51cbac91af741e53e96c89f633bd2a6ad)
|
|
(cherry picked from commit 78f17b2a98e9c7ce4a28c48955ef312157099a69)
|
|
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)
|
|
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)
|
|
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)
|
|
Differential Revision: https://reviews.llvm.org/D142494
(cherry picked from commit c510c387631ee58ccba74d6ad0f375d2ab098bb2)
|
|
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)
|
|
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)
|
|
(cherry picked from commit 3b059cd25b8ce31762b76a3b172fdd811c07dc34)
|
|
`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)
|
|
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)
|
|
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)
|
|
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)
|
|
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D142526
(cherry picked from commit ba43f3e857390932fede4aedf3e57d8f3787e804)
|
|
Differential Revision: https://reviews.llvm.org/D143245
(cherry picked from commit 8e13ec9eca1fc758c213a94b563221e6afc5b031)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
Reviewed By: #libc, ldionne, tstellar
Differential Revision: https://reviews.llvm.org/D142873
|
|
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
|
|
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
|
|
Remove __unexpected namespace.
Reviewed By: philnik, #libc, ldionne
Differential Revision: https://reviews.llvm.org/D141947
|
|
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
|
|
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
|
|
- 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
|
|
As pointed out in a post-commit comment of https://reviews.llvm.org/rGd00e035a4270.
Differential Revision: https://reviews.llvm.org/D142365
|
|
Differential Revision: https://reviews.llvm.org/D140913
|
|
|
|
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
|
|
__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
|
|
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D142007
|
|
This part should be guarded, but there are no proper guards yet.
Therefore disable the offending part. This was reported post commit in
D140653.
|
|
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
|
|
`<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
|
|
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
|
|
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
|
|
Reviewed By: philnik
Differential Revision: https://reviews.llvm.org/D142134
|
|
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
|
|
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
|
|
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
|