Commit Graph

257 Commits

Author SHA1 Message Date
Konstantin Varlamov db7d795978 [libc++][ranges] Implement `std::ranges::partial_sort_copy`.
Differential Revision: https://reviews.llvm.org/D130532
2022-07-30 02:42:18 -07:00
Hui Xie 72f57e3a30 [libc++][ranges] implement `std::ranges::unique{_copy}`
implement `std::ranges::unique` and `std::ranges::unique_copy`

Differential Revision: https://reviews.llvm.org/D130404
2022-07-29 08:28:17 +01:00
Hui Xie 8a61749f76 [libc++][ranges] implement `std::ranges::inplace_merge`
Differential Revision: https://reviews.llvm.org/D130627
2022-07-28 08:37:48 +01:00
Mark de Wever 41f7bb9975 [libc++][chrono] Uses operator<=> in the calendar.
Since the calendar is added in C++20 the existing operators are removed.

Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D129887
2022-07-27 21:53:08 +02:00
Nikolas Klauser 98d3d5b5da [libc++] Implement P1004R2 (constexpr std::vector)
Reviewed By: #libc, ldionne

Spies: mgorny, var-const, ormris, philnik, miscco, hiraditya, steven_wu, jkorous, ldionne, christof, libcxx-commits

Differential Revision: https://reviews.llvm.org/D68365
2022-07-27 20:26:44 +02:00
Mark de Wever 02761e3fae [libc++][doc] Updates format status page.
Remove some no longer relevant details and adds the C++23 papers voted
in at the last plenary.
2022-07-27 17:39:08 +02:00
Mark de Wever 759efa763a [libc++][doc] Updates status documents.
Adds the papers and LWG issues voted in during the July 2022 plenary.

Note the updating of the project based statuses is left to the active
contributors of these projects.

Reviewed By: #libc, huixie90, philnik

Differential Revision: https://reviews.llvm.org/D130595
2022-07-27 17:31:40 +02:00
Konstantin Varlamov d406c6493e [libc++][ranges] Implement `ranges::is_heap{,_until}`.
Differential Revision: https://reviews.llvm.org/D130547
2022-07-26 16:11:24 -07:00
Konstantin Varlamov ead7302bbb [libc++][ranges] Implement `ranges::generate{,_n}`.
Differential Revision: https://reviews.llvm.org/D130552
2022-07-26 15:50:32 -07:00
Konstantin Varlamov 14cf74d65d [libc++][ranges] Implement `ranges::shuffle`.
Differential Revision: https://reviews.llvm.org/D130321
2022-07-22 09:59:13 -07:00
Louis Dionne deb3b5552f [libc++] Take advantage of -fexperimental-library in libc++
When -fexperimental-library is passed, libc++ will now pick up the
appropriate __has_feature flag defined by Clang to enable the
experimental library features.

As a fly-by, also update the documentation for the various TSes.

Differential Revision: https://reviews.llvm.org/D130176
2022-07-22 08:33:39 -04:00
Hui Xie c559964d85 [libc++][ranges] implement `std::ranges::includes`
implement `std::ranges::includes` and delegate to `std::includes`

Differential Revision: https://reviews.llvm.org/D130116
2022-07-22 10:27:48 +01:00
Hui Xie 0f6364b8a1 [libc++][ranges] implement `std::ranges::equal_range`
implement `std::ranges::equal_range` which delegates to
`std::equal_range`

Differential Revision: https://reviews.llvm.org/D129796
2022-07-22 10:24:08 +01:00
Konstantin Varlamov 065202f3ca [libc++][ranges] Implement `std::ranges::partition_{point,copy}`.
Reviewed By: #libc, huixie90, ldionne

Differential Revision: https://reviews.llvm.org/D130070
2022-07-20 11:39:07 -07:00
Mark de Wever b32e600edd [libc++][format] Updates the status page. 2022-07-20 19:26:28 +02:00
Nikolas Klauser 309aed3068 [libc++] Implement P1423R3 (char8_t backward compatibility remediation)
Reviewed By: Mordante, #libc

Spies: h-vetinari, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D129195
2022-07-20 11:27:51 +02:00
varconst 5dd19ada57 [libc++][ranges] Implement `ranges::partial_sort`.
Differential Revision: https://reviews.llvm.org/D128744
2022-07-19 20:10:34 -07:00
Louis Dionne 8711fcae27 [libc++] Treat incomplete features just like other experimental features
In particular remove the ability to expel incomplete features from the
library at configure-time, since this can now be done through the
_LIBCPP_ENABLE_EXPERIMENTAL macro.

Also, never provide symbols related to incomplete features inside the
dylib, instead provide them in c++experimental.a (this changes the
symbols list, but not for any configuration that should have shipped).

Differential Revision: https://reviews.llvm.org/D128928
2022-07-19 10:50:20 -04:00
Konstantin Varlamov 8ed702b83f [libc++][ranges] Implement `ranges::{,stable_}partition`.
Differential Revision: https://reviews.llvm.org/D129624
2022-07-18 21:06:17 -07:00
Nikolas Klauser 5492b71db3 [libc++] Update RangesAlgorithms.csv 2022-07-15 00:18:31 +02:00
Hui Xie 3151b95dad [libc++][ranges] implement `std::ranges::set_union`
[libc++][ranges] implement `std::ranges::set_union`

Differential Revision: https://reviews.llvm.org/D129657
2022-07-14 21:05:30 +01:00
Hui Xie a5c0638dec [libc++][ranges] implement `std::ranges::set_symmetric_difference`
[libc++][ranges] implement `std::ranges::set_symmetric_difference`

Differential Revision: https://reviews.llvm.org/D129520
2022-07-13 21:24:32 +01:00
Nikolas Klauser 101d1e9b3c [libc++] Implement ranges::find_end, ranges::search{, _n}
Reviewed By: var-const, #libc, huixie90

Spies: thakis, h-vetinari, huixie90, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D124079
2022-07-13 20:30:55 +02:00
Nikolas Klauser 1f04759316 Revert "[libc++] Implement ranges::find_end, ranges::search{, _n}"
This reverts commit 76a7651850.
2022-07-13 13:41:25 +02:00
Nikolas Klauser 76a7651850 [libc++] Implement ranges::find_end, ranges::search{, _n}
Reviewed By: var-const, #libc, huixie90

Spies: h-vetinari, huixie90, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D124079
2022-07-13 13:11:26 +02:00
Konstantin Varlamov d4c53202eb [libc++][ranges][NFC] Consolidate some repetitive range algorithm tests:
- checking that the algorithm supports predicates returning
  a non-boolean type that's implicitly convertible to `bool`;
- checking that predicates and/or projections are invoked using
  `std::invoke`.

Differential Revision: https://reviews.llvm.org/D129414
2022-07-12 02:06:36 -07:00
Raul Tambre 1544d1f9fd [libc++] Undeprecate ATOMIC_FLAG_INIT (LWG3659)
According to @aaron.ballman this was marked Tentatively Ready as of 2022-07-07.
D129362 implemented the C counterpart.

Reviewed By: ldionne, #libc, Mordante

Differential Revision: https://reviews.llvm.org/D129380
2022-07-12 08:00:40 +03:00
Nikolas Klauser 7d426a392f [libc++] Implement ranges::{reverse, rotate}_copy
Reviewed By: var-const, #libc

Spies: huixie90, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D127211
2022-07-11 21:13:08 +02:00
Hui Xie 96b674f23c [libc++][ranges] implement `std::ranges::set_intersection`
implement `std::ranges::set_intersection` by reusing the classic `std::set_intersenction`
added unit tests

Differential Revision: https://reviews.llvm.org/D129233
2022-07-11 06:55:09 +01:00
Mark de Wever 606e280811 [libc++][format] Use forwarding references.
This implements a not accepted LWG issue. Not doing so would require
integral types to use the handle class instead of being directly stored
in the basic_format_arg.

The previous code used `std::forward` in places where it wasn't required
by the Standard. These are now removed.

Implements:
- P2418R2 Add support for std::generator-like types to std::format
- LWG 3631 basic_format_arg(T&&) should use remove_cvref_t<T> throughout

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D127570
2022-07-10 17:19:28 +02:00
Konstantin Varlamov c945bd0da6 [libc++][ranges] Implement modifying heap algorithms:
- `ranges::make_heap`;
- `ranges::push_heap`;
- `ranges::pop_heap`;
- `ranges::sort_heap`.

Differential Revision: https://reviews.llvm.org/D128115
2022-07-08 13:48:41 -07:00
Konstantin Varlamov 23c7328bad [libc++][ranges] Implement `ranges::nth_element`.
Differential Revision: https://reviews.llvm.org/D128149
2022-07-08 11:26:02 -07:00
Hui Xie 1cdec6c96e [libcxx][ranges] implement `std::ranges::set_difference`
implement `std::ranges::set_difference`
reused classic std::set_difference
added unit tests

Differential Revision: https://reviews.llvm.org/D128983
2022-07-08 13:26:23 +01:00
Nikolas Klauser a3ac6891f8 [libc++] Fix a few things in RangesAlgorithms.csv 2022-07-07 01:57:20 +02:00
Nikolas Klauser f8cbe3cdf0 [libc++] Implement ranges::remove{, _if}
Reviewed By: var-const, #libc

Spies: huixie90, sstefan1, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D128618
2022-07-06 18:47:13 +02:00
Hui Xie 25607d143d [libc++] Implement `std::ranges::merge`
Implement `std::ranges::merge`. added unit tests

Differential Revision: https://reviews.llvm.org/D128611
2022-07-04 13:44:31 +01:00
Konstantin Varlamov 94c7b89fe5 [libc++][ranges] Implement `ranges::stable_sort`.
Differential Revision: https://reviews.llvm.org/D127834
2022-07-01 16:34:26 -07:00
Nikolas Klauser 3ee9a50a14 [libc++] Implement P0618R0 (Deprecating <codecvt>)
Reviewed By: ldionne, #libc

Spies: cfe-commits, llvm-commits, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127313
2022-06-30 16:47:50 +02:00
Konstantin Varlamov 79a2b4ba98 [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal.
- P1252 ("Ranges Design Cleanup") -- deprecate
  `move_iterator::operator->` starting from C++20; add range comparisons
  to the `<functional>` synopsis. This restores
  `move_iterator::operator->` that was incorrectly deleted in D117656;
  it's still defined in the latest draft, see
  http://eel.is/c++draft/depr.move.iter.elem. Note that changes to
  `*_result` types from 6.1 in the paper are no longer relevant now that
  these types are aliases;
- P2106 ("Alternative wording for GB315 and GB316") -- add a few
  `*_result` types to the synopsis in `<algorithm>` (some algorithms are
  not implemented yet and thus some of the proposal still cannot be
  marked as done);

Also mark already done issues as done (or as nothing to do):
- P2091 ("Fixing Issues With Range Access CPOs") was already implemented
  (this patch adds tests for some ill-formed cases);
- LWG 3247 ("`ranges::iter_move` should perform ADL-only lookup of
  `iter_move`") was already implemented;
- LWG 3300 ("Non-array ssize overload is underconstrained") doesn't
  affect the implementation;
- LWG 3335 ("Resolve C++20 NB comments US 273 and GB 274") was already
  implemented;
- LWG 3355 ("The memory algorithms should support move-only input
  iterators introduced by P1207") was already implemented (except for
  testing).

Differential Revision: https://reviews.llvm.org/D126053
2022-06-28 12:00:15 -07:00
Mark de Wever e7d1cc923e [libc++][doc] Fixes a broken table entry. 2022-06-27 17:43:51 +02:00
Nikolas Klauser 56a33ba3dd [libc++] Implement P0154R1 (Hardware inference size)
`__GCC_CONSTRUCTIVE_SIZE` and `__GCC_DESTRUCTIVE_SIZE` are available since GCC 12. I'm assuming clang will also implement these for compatability with libstdc++.

Reviewed By: ldionne, #libc

Spies: h-vetinari, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D122276
2022-06-23 01:31:09 +02:00
Nikolas Klauser 681cde7dd8 [libc++] Complete the implementation of N4190
Fixes #37402

Reviewed By: ldionne

Spies: EricWF, avogelsgesang, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D124346
2022-06-22 10:13:03 +02:00
Nikolas Klauser 2fcf99d703 [libc++] Implement P0174R2 (Deprecating Vestigial Library Parts in C++17)
Reviewed By: ldionne, Mordante, #libc

Spies: jwakely, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127387
2022-06-21 08:22:44 +02:00
Konstantin Varlamov d417710c3a [libc++][ranges][NFC] Fix a format error on the ranges status page. 2022-06-18 02:22:26 -07:00
Konstantin Varlamov ff3989e6ae [libc++][ranges] Implement `ranges::sort`.
Differential Revision: https://reviews.llvm.org/D127557
2022-06-16 15:21:06 -07:00
Mark de Wever 3433f78c40 [libc++][doc] Update formatting status. 2022-06-16 19:37:49 +02:00
Nikolas Klauser afd5a4f2dc [libc++] Implement ranges::lexicographical_compare
Reviewed By: var-const, Mordante, #libc

Spies: H-G-Hristov, sstefan1, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D127130
2022-06-15 22:29:21 +02:00
Nikolas Klauser ee397722cc [libc++][NFC] Update ranges algorithms status page 2022-06-11 16:21:34 +02:00
Mark de Wever aed5ddf8d0 [libc++][format] Implement format-string.
Implements the compile-time checking of the formatting arguments.

Completes:
- P2216 std::format improvements

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D121530
2022-06-11 15:25:56 +02:00
Nikolas Klauser ff6d5dee71 [libc++] Implement ranges::replace{, _if}
Reviewed By: var-const, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D126283
2022-06-10 11:54:46 +02:00