Commit Graph

9515 Commits

Author SHA1 Message Date
Vitaly Buka 69c09d11f8 [test][libcxx] Don't XFAIL passing test with HWASAN 2022-08-16 09:37:16 -07:00
Vitaly Buka e6933044a7 [test][libcxx] Use own feature for HWAsan 2022-08-16 00:05:48 -07:00
Vitaly Buka 06d16eb9e6 [test][libcxx] Disable new.delete.array tests for HWAsan 2022-08-16 00:05:48 -07:00
David Blaikie c63f2581f4 Enable -Wctad-maybe-unsupported in LLVM build
Warns on potentially unintended use of C++17 Class Template Argument
Deduction. Use of this feature with types that aren't intended to
support it may may future refactorings of those types more difficult -
so this warning fires whenever the feature is used with a type that may
not have intended to be used with CTAD (the warning uses the existence
of at least one explicit deduction guide to indicate that a type
intentionally supports CTAD - absent that, it's assumed to not be
intended to support CTAD & produces a warning).

This is disabled in libcxx because lots of the standard library is
assumed to provide ctad-usable APIs and the false positive suppression
in the diagnostic is based on system header classification which doesn't
apply in the libcxx build itself.

Differential Revision: https://reviews.llvm.org/D131727
2022-08-15 23:28:51 +00:00
Adrian Vogelsgesang 877620bd96 [libc++] Implement `operator<=>` for `error_{code,condition}`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D131371
2022-08-15 16:05:53 -07:00
Adrian Vogelsgesang 0e876eda26 [libc++] Implement `operator<=>` for `error_category`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D131363
2022-08-15 16:05:08 -07:00
Vitaly Buka ace3ce8ad7 [test][libc++][hwasan] Handle hwaddress_sanitizer 2022-08-15 13:50:54 -07:00
Igor Zhukov f7f5308b82 [libc++][test] Fix conversion signed/unsigned in test/support/MoveOnly.h
Reviewed By: jloser, philnik

Differential Revision: https://reviews.llvm.org/D131889
2022-08-15 22:09:54 +07:00
Kent Ross c4566cac49 [libc++][spaceship] Implement std::variant::operator<=>
Implements [variant.relops] and [variant.monostate.relops] for P1614R2

Reviewed By: Mordante, #libc, avogelsgesang

Differential Revision: https://reviews.llvm.org/D131372
2022-08-14 16:16:52 -07:00
Nico Weber aacf1a9742 Revert "[clang] adds unary type transformations as compiler built-ins"
This reverts commit bc60cf2368.
Doesn't build on Windows and breaks gcc 9 build, see
https://reviews.llvm.org/D116203#3722094 and
https://reviews.llvm.org/D116203#3722128

Also revert two follow-ups. One fixed a warning added in
bc60cf2368, the other
makes use of the feature added in bc60cf2368
in libc++:

Revert "[libcxx][NFC] utilises compiler builtins for unary transform type-traits"
This reverts commit 06a1d917ef.

Revert "[Sema] Fix a warning"
This reverts commit c85abbe879.
2022-08-14 15:58:21 -04:00
Christopher Di Bella 06a1d917ef [libcxx][NFC] utilises compiler builtins for unary transform type-traits
Depends on D116203

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D131732
2022-08-14 17:32:38 +00:00
Igor Zhukov 0c90d5f7e9 [libc++][test] fix C4267 warning in bitset.members\to_ulong.pass.cpp
Reviewed By: philnik

Differential Revision: https://reviews.llvm.org/D131854
2022-08-14 22:24:58 +07:00
Mark de Wever 22b5adff71 [libc++] Uses operator<=> in string.
Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: avogelsgesang, #libc, philnik

Differential Revision: https://reviews.llvm.org/D131421
2022-08-14 14:05:05 +02:00
Mark de Wever 3ec6900298 [libc++][test] Disables clang-tidy test for GCC.
Increasing the constexpr evaluation limit breaks this clang-tidy test
for GCC. As discussed in D131317 disable the test in GCC.

Reviewed By: philnik, #libc

Differential Revision: https://reviews.llvm.org/D131835
2022-08-14 13:39:12 +02:00
Nikolas Klauser f02120fba2 [libc++] Implement P2417R2 (A more constexpr bitset)
Reviewed By: ldionne, #libc

Spies: jloser, arichardson, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D131218
2022-08-14 10:34:01 +02:00
Nikolas Klauser 7ae66e5e95 [libc++] Granularize the rest of type_traits
Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D130471
2022-08-14 10:30:48 +02:00
Adrian Vogelsgesang 41e7665c4b [libc++] Implement `operator<=>` for `thread::id`
The new operator<=> is mapped onto the existing functions
__libcpp_thread_id_equal and __libcpp_thread_id_less. Introducing a
new __libcpp_thread_id_compare_three_way might lead to more efficient
code. Given that we can still introduce __libcpp_thread_id_compare_three_way
later, for this commit I opted to not break ABI. If requested, I will
add __libcpp_thread_id_compare_three_way in a follow-up commit.

Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D131362
2022-08-13 17:30:55 -07:00
Nikolas Klauser 80c7e93a2a [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI
Reviewed By: ldionne, Mordante, var-const, huixie90, #libc

Spies: jloser, libcxx-commits, arichardson, miyuki

Differential Revision: https://reviews.llvm.org/D129968
2022-08-13 22:41:22 +02:00
Nikolas Klauser ae87a3bf0a [libc++] Simplify __config a bit more and add underscores to attributes
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D129457
2022-08-13 12:43:26 +02:00
Vitaly Buka 18014fe0a9 [libcxx][hwasan] Add basic HWAddress support 2022-08-13 00:04:55 -07:00
Adrian Vogelsgesang d7e0cec60e [libc++][test] Mark `test_comparisons.h` helpers as nodiscard
I accidentally wrote `testComparisons(...)` instead of
`assert(testComparisons(...))`. This compiled without issues, but
did not provide the intended test coverage. By adding a `nodiscard`,
we can make sure that the compiler catches such mistakes for us.

Differential Revision: https://reviews.llvm.org/D131364
2022-08-12 03:30:33 -07:00
Amy Kwan e2e9e2ce8e [libcxx] [test] Fix max_size.pass.cpp for PowerPC targets
This patch fixes the max_size.pass.cpp test for PowerPC targets, depending on
endianness.

We will exhibit the full_size() behaviour for little endian
(where __endian_factor = 2 ), and the half_size() behaviour for
big endian (where __endian_factor = 1).

Differential Revision: https://reviews.llvm.org/D131682
2022-08-11 21:39:29 -05:00
Louis Dionne 8c6319e30a [libc++] Add a missing assertion in std::span's constructor
Also, add missing tests for assertions in span constructors. Now I
believe that all of std::span's API should be hardened, and all the
assertions should have a corresponding test.

Differential Revision: https://reviews.llvm.org/D131681
2022-08-11 15:31:46 -04:00
Nikolas Klauser 499fca3cfc [libc++][NFC] Replace macros in vector
Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D130848
2022-08-11 20:22:58 +02:00
Martin Storsjö b8717d19cf [libcxx] [test] Merge the experimental-lib-exports testcases into static-lib-exports
Since bb939931a1, the c++experimental
library is always built, so these tested files should always be built
(even if they aren't used in tests).

Differential Revision: https://reviews.llvm.org/D129399
2022-08-11 10:15:12 +03:00
Louis Dionne 497705ff27 [libc++] Reorganize the documentation of extensions for integral types 2022-08-10 17:35:08 -04:00
Adrian Vogelsgesang 2d34cb74b5 [libc++] Implement `thread::id` comparators as free functions
So far, the `thread::id` comparators were implemented as hidden friends.
This was non-conforming and lead to incorrectly rejected C++ code, as
can be seen in the linked Github issue.

Fixes https://github.com/llvm/llvm-project/issues/56187

Differential Revision: https://reviews.llvm.org/D131430
2022-08-10 11:39:50 -07:00
Mark de Wever 70074cf397 [libc++] Fixes string_view comparison operators.
While implementing `operator<=>` for `string_view` (D130295) @philnik
pointed out `common_type` should be `type_identity`. Since it was an
existing issue that wasn't addressed.

This addresses the issue for both the new and existing equality and
comparison operators. The test is based on the example posted in
D130295.

Reviewed By: philnik, #libc, huixie90

Differential Revision: https://reviews.llvm.org/D131322
2022-08-10 19:38:50 +02:00
Mark de Wever 35bb1f5f34 [NFC][libc++][test] Removes unneeded code.
In D130295 @mumbleskates wondered why `std::strong_ordering::equal` had
special code since it's the same as `std::strong_ordering::equivalent`.

This is indeed the case so the special case can be removed.

Reviewed By: mumbleskates, #libc, avogelsgesang, ldionne

Differential Revision: https://reviews.llvm.org/D131419
2022-08-10 19:00:55 +02:00
Louis Dionne b1009bbd9e [libc++] Add missing includes of <cstddef> 2022-08-10 11:35:41 -04:00
Louis Dionne f5738c5145 [libc++] Make __libcpp_verbose_abort [[noreturn]]
This will allow using it in functions that are [[noreturn]] themselves.

Differential Revision: https://reviews.llvm.org/D131408
2022-08-10 10:37:15 -04:00
Adrian Vogelsgesang 9df5892804 [libc++] Implement `operator<=>` for `type_index`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D131357
2022-08-09 16:35:17 -07:00
Adrian Vogelsgesang cfefee87c2 [libc++][NFC] Remove TEST_HAS_NO_SPACESHIP_OPERATOR
The corresponding _LIBCPP_HAS_NO_SPACESHIP_OPERATOR macro was already
removed in commit c0f87e8382

Differential Revision: https://reviews.llvm.org/D131215
2022-08-09 16:32:54 -07:00
Mark de Wever 195287d90a [libc++][ranges] Sets ranges feature-test macro.
D131234 marked the ranges papers as complete, but it didn't set the
feature-test macro.

Reviewed By: ldionne, var-const, #libc

Differential Revision: https://reviews.llvm.org/D131326
2022-08-09 17:20:36 +02:00
Adrian Vogelsgesang 706b3951b3 [libc++] Implement `operator==` for `filesystem::space_info`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D130861
2022-08-08 10:05:47 -07:00
Adrian Vogelsgesang 3354644aad [libc++][doc] Update `SpaceshipProjects` status to reflect in-flight reviews 2022-08-08 06:39:12 -07:00
Louis Dionne 27442728cd [libc++][NFC] Fix signature of main in test 2022-08-08 09:30:29 -04:00
Louis Dionne 0a5c344a84 [libc++] Add missing <stdbool.h> to the modulemap
It used to be defined by the compiler, but libc++ now provides it.

Differential Revision: https://reviews.llvm.org/D131201
2022-08-08 09:00:57 -04:00
Louis Dionne e36f9e13bc [libc++] Allow enabling assertions when back-deploying
When back-deploying to older platforms, we can still provide assertions,
but we might not be able to provide a great implementation for the verbose
handler. Instead, we can just call ::abort().

Differential Revision: https://reviews.llvm.org/D131199
2022-08-08 08:43:34 -04:00
Adrian Vogelsgesang fc40804a5a [libc++][NFC] Fix `the the` in comment in `__format/buffer.h`
I made this commit primarily to test my commit access to the LLVM repo

Differential Revision: https://reviews.llvm.org/D131365
2022-08-07 11:14:43 -07:00
Igor Zhukov 6bb51bf062 [libc++][test] Fix MSVC warnings C6054, C6001, C4242 in format_tests.h
Reviewed By: Mordante

Differential Revision: https://reviews.llvm.org/D131336
2022-08-07 16:55:50 +07:00
Adrian Vogelsgesang 619e8f46f3 [libc++] Remove `operator!=` from `type_info` in C++20
Implements part of:

* P1614R2 The Mothership has Landed

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130853
2022-08-06 15:10:38 +02:00
Adrian Vogelsgesang 735240b38f [libc++] Implement `operator<=>` for `unique_ptr`
Implements part of:

  - P1614R2 The Mothership has Landed

Fixes LWG3426

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130838
2022-08-06 15:09:16 +02:00
Konstantin Varlamov 3fa291fa92 [libc++][ranges][NFC] Mark the completed Ranges papers and issues as done.
The newly-completed papers:
- P0896R4 ("The One Ranges Proposal");
- P1243R4 ("Rangify New Algorithms");
- P1252R2 ("Ranges Design Cleanup");
- P1716R3 ("Range Comparison Algorithms Are Over-Constrained");
- P1871R1 ("Concept traits should be named after concepts");
- P2106R0 ("Alternative wording for GB315 and GB316").

Differential Revision: https://reviews.llvm.org/D131234
2022-08-05 14:03:02 -07:00
Konstantin Varlamov 8ac015caf6 [libc++][ranges][NFC] Make sure all implemented algorithms are enabled in "robust" tests.
Also fix `std::find_first_of` (which accidentally copied the predicate
in the implementation).

Differential Revision: https://reviews.llvm.org/D131235
2022-08-05 14:02:12 -07:00
Louis Dionne cf08452e91 [libc++] Clarify comment in CI pipeline definition
This partially reverts commit 7d855bb8e1. The comments were actually
not outdated, they were simply unclear.
2022-08-04 14:08:07 -04:00
Louis Dionne 7d855bb8e1 [libc++][NFC] Remove outdated comment in CI pipeline definition 2022-08-04 14:03:23 -04:00
Konstantin Varlamov 52d4c5016c [libc++] Fix a hard error in `contiguous_iterator<NoOperatorArrowIter>`.
Evaluating `contiguous_iterator` on an iterator that satisfies all the
constraints except the `to_address` constraint and doesn't have
`operator->` defined results in a hard error. This is because
instantiating `to_address` ends up instantiating templates
dependent on the given type which might lead to a hard error even
in a SFINAE context.

Differential Revision: https://reviews.llvm.org/D130835
2022-08-04 10:58:21 -07:00
Nikolas Klauser 4038c859e5 [libc++][ranges] Implement `ranges::is_permutation`
Co-authored-by: Konstantin Varlamov <varconst@apple.com>

Differential Revision: https://reviews.llvm.org/D127194
2022-08-04 10:54:37 -07:00
Mark de Wever 3818b4df1e [libc++] Uses operator<=> in string_view
Implements:
- LWG3432 Missing requirement for comparison_category

Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: #libc, ldionne, jloser, philnik

Differential Revision: https://reviews.llvm.org/D130295
2022-08-04 19:13:47 +02:00