Commit Graph

9492 Commits

Author SHA1 Message Date
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
Igor Zhukov 1915c1c01e [libc++][NFC] Remove rebase artifact
I found it in this commit: a203acb9dd

Reviewed By: Mordante

Differential Revision: https://reviews.llvm.org/D131163
2022-08-04 22:53:32 +07:00
Mark de Wever d1d799b696 [libc++][doc] Updates format status page.
Adds the details for P2286 and its status.
2022-08-04 17:40:38 +02:00
Nikolas Klauser 648d99e7dd [libc++] Install clang-tools in the CI container
This is required for using clang-query in the CI

Reviewed By: Mordante, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D130845
2022-08-04 16:42:42 +02:00
Nikolas Klauser a203acb9dd [libc++][ranges] Implement `ranges::clamp`
Differential Revision: https://reviews.llvm.org/D126193
2022-08-04 02:45:32 -07:00
Konstantin Varlamov 36c746ca2d [libc++][ranges] Implement `ranges::rotate`.
Also fix `ranges::stable_sort` and `ranges::inplace_merge` to support
proxy iterators now that their internal implementations can correctly
dispatch `rotate`.

Differential Revision: https://reviews.llvm.org/D130758
2022-08-03 16:04:24 -07:00
Adrian Vogelsgesang 3b217f2f12 [libc++] Implement `operator<=>` for `shared_ptr`
Implements part of:

* P1614R2 The Mothership has Landed

Fixes LWG3427

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130852
2022-08-03 18:32:45 +02:00
Louis Dionne 144cea2ce9 [libc++] Mark -fexperimental-library test as unsupported on another AppleClang 2022-08-03 12:24:00 -04:00
Casey Carter 3a45677467 [libcxx][test] Silence narrowing warning 2022-08-03 09:10:47 -07:00
Louis Dionne b7fb856397 [libc++] Simplify how we define the linker script for libc++
Trying to be generic didn't work properly because we had to special-case
some interface libraries that we didn't want in the linker script. Instead,
only look at the ABI and the unwinding libraries explicitly.

This should solve the issue reported by @dim in [1].

[1]: https://discourse.llvm.org/t/15-0-0-rc1-has-been-tagged/64174/22

Differential Revision: https://reviews.llvm.org/D131037
2022-08-03 09:29:50 -04:00
Louis Dionne 3d5d44269c [libc++] More documentation improvements about running tests 2022-08-03 09:25:01 -04:00
Nikolas Klauser 68264b6494 [libc++][ranges] Implement `ranges::{prev, next}_permutation`.
Co-authored-by: Konstantin Varlamov <varconst@apple.com>

Differential Revision: https://reviews.llvm.org/D129859
2022-08-02 22:46:15 -07:00
cpplearner 8a78b72289 [libc++][test] Replace `_LIBCPP_STD_VER` with `TEST_STD_VER`
Differential Revision: https://reviews.llvm.org/D130979
2022-08-03 13:54:04 +08:00
Konstantin Varlamov 6bdb642234 [libc++][ranges] Implement `ranges::sample`.
Differential Revision: https://reviews.llvm.org/D130865
2022-08-02 22:34:23 -07:00
Nikolas Klauser 93172c1c2b [libc++][ranges] Implement `ranges::replace_copy{,_if}`.
Co-authored-by: Konstantin Varlamov <varconst@apple.com>

Differential Revision: https://reviews.llvm.org/D129806
2022-08-02 22:32:01 -07:00
Konstantin Varlamov f537a01d39 [libc++][ranges] Fix the return value of `{copy,move}_backward`.
The return value for both of these algorithms is specified as
```
`{last, result - N}` for the overloads in namespace `ranges`.
```
But the current implementation instead returns `{first, result - N}`.

Also add both algorithms to the relevant "robust" tests.

Differential Revision: https://reviews.llvm.org/D130968
2022-08-02 22:22:59 -07:00
Nikolas Klauser 760d2b462c [libc++][ranges] Implement `ranges::remove_copy{, _if}`.
Co-authored-by: Hui Xie <hui.xie1990@gmail.com>

Differential Revision: https://reviews.llvm.org/D130599
2022-08-02 22:19:13 -07:00
Michał Górny 39d4e169d3 [libc++][test] Propagate host environment to libc++ test suite
Propagate the complete host environment to the tests run via the new
testconfig. This ensures that all envvars needed e.g. for the compiler
to work correctly are present. This mimics the behavior explicitly
implemented in the legacy config.

https://github.com/llvm/llvm-project/issues/56816

Differential Revision: https://reviews.llvm.org/D130843
2022-08-02 21:53:03 -04:00
Igor Zhukov 495519e5f8 [libc++][NFC] Don't rely on `<algorithm>` transitively including `<memory>` in tests
Found by @cpplearner (https://github.com/microsoft/STL/pull/2976#discussion_r935440806)

Differential Revision: https://reviews.llvm.org/D130997
2022-08-02 20:46:05 -04:00
Igor Zhukov db0ac307c9 [libc++] Fix warning C4244 in std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
frederick-vs-ja noticed that https://github.com/microsoft/STL/pull/2976#issuecomment-1201926893
while we are working on updating LLVM submodule for MS STL:

    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): error C2220: the following warning is treated as an error
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(287): note: see reference to function template instantiation 'void tests<__int64>(void)' being compiled
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data

Differential Revision: https://reviews.llvm.org/D130963
2022-08-02 20:44:46 -04:00
Louis Dionne ce6aff8d13 [libc++] Update documentation on testing libc++ 2022-08-02 16:16:02 -04:00
Casey Carter a1a30dc933 [libcxx][test] Test code should inspect `TEST_STD_VER`, not `_LIBCPP_STD_VER`. 2022-08-02 12:07:29 -07:00
Mark de Wever f712775daf [libc++][format] Exposes basic-format-string
This paper was accepted during the last plenary and is intended to be
backported to LLVM 15. When backporting the release notes in the branch
should be updated too.

Note the feature-test macro isn't updated since this will change; three
papers have updated the same macro in the same plenary.

Implements:
- P2508R1 Exposing std::basic-format-string

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D130643
2022-08-02 20:33:17 +02:00
Adrian Vogelsgesang ceebf91744 [libc++][doc] Update spaceship status page
* `operator<=>` for `iota_view::iterator` was enabled in 8320017b79
    * Removed P2405R0 which was not accepted and seems inactive
      (https://github.com/cplusplus/papers/issues/1075)
    * Added the previously missing `operator==` for `filesystem::space_info`
      to the tracking list.
    * Updated the "Assignee" for `string_view`, `string` as Mark de Wever
      mentioned he is working on them in Discord
    * Updated the status of the items for which I sent review requests
      yesterday.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130855
2022-08-02 20:11:03 +02:00