467 Commits

Author SHA1 Message Date
Piotr Fusik
c7c0095b29 [libc++] Implement stringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: Mordante, #libc

Differential Revision: https://reviews.llvm.org/D155359
2023-07-16 18:32:56 +02:00
Piotr Fusik
6ed4041891 [libc++] Implement ostringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D155276
2023-07-16 15:25:35 +02:00
Christian Trott
20c6b9d451 [libc++][mdspan] Implement default_accessor
This commit implements default_accessor in support of C++23 mdspan
(https://wg21.link/p0009). default_accessor is the trivial accessor
using plain pointers and reference to element types.

Co-authored-by: Damien L-G <dalg24@gmail.com>

Differential Revision: https://reviews.llvm.org/D153935
2023-07-14 11:52:40 -06:00
Piotr Fusik
61d2a9b3ea [libc++] Implement istringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D154454
2023-07-14 08:32:27 +02:00
Mark de Wever
438073b213 [libc++][doc] Removes clang name in version number.
Noticed I had these left in just committed code.
2023-07-08 13:36:32 +02:00
Mark de Wever
d3d079678c [NFC][libc++] Addresses LWG3905.
Note libc++ implemented this in its initial version. It always used the type
from the C library and never validated whether it was an integer type.

Implements
- LWG3905 Type of std::fexcept_t

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153285
2023-07-08 12:56:46 +02:00
Mark de Wever
00e740f1e9 [NFC][libc++] Addresses LWG3903.
Note libc++ actually implemented this wording from the start (D49338).
The Clang version is the same as the version that implements
  P0122R7 <span>

Implements
- LWG3903 span destructor is redundantly noexcept

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153284
2023-07-08 12:54:49 +02:00
Mark de Wever
f8d96d8e06 [NFC][libc++] Addresses LWG3885.
Implements
- LWG3885 'op' should be in [zombie.names]

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153283
2023-07-08 12:27:24 +02:00
yrong
1e02158666 [libc++] Implement LWG3843 (std::expected<T,E>::value() & assumes E is copy constructible)
Implement LWG3843 (std::expected<T,E>::value() & assumes E is copy constructible)
https://wg21.link/LWG3843

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154110
2023-07-08 11:57:00 +08:00
Nikolas Klauser
75f6af82c3 [libc++] Mark LWG2994 as complete and remove Clang from the version
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D154381
2023-07-05 14:43:04 -07:00
Mark de Wever
a9e5773f52 [libc++][format] Implements formatting pointer.
The feature is applied as DR instead of a normal paper. MSVC STL and
libstdc++ will do the same.

Implements
- P2510R3 Formatting pointers

Depends on D153192

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D153195
2023-07-05 18:23:31 +02:00
Louis Dionne
fc5e76da22 [libc++] Reformat status tables
We use 17.0 instead of Clang 17 in our status tables pretty consistently,
but not universally. This ensures that we do it universally, for all
versions.

Differential Revision: https://reviews.llvm.org/D154461
2023-07-05 08:37:19 -04:00
Piotr Fusik
81ad5a5cb8 [libc++] Implement stringbuf members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D153709
2023-07-01 13:43:08 +02:00
Mark de Wever
5bf142749e [libc++][doc] Updates spaceship status.
Work on the missing chrono parts has started, but their operators will
be added in different patches. So split the remaining chrono part to one
entry per line and mark them in progress.
2023-07-01 12:37:02 +02:00
Christian Trott
b4ff893877 [libc++][mdspan] Implement layout_left
This commit implements layout_left in support of C++23 mdspan
(https://wg21.link/p0009). layout_left is a layout mapping policy
whose index mapping corresponds to the memory layout of Fortran arrays.
Thus the left most index has stride-1 access, and the right most index
is associated with the largest stride.

Co-authored-by: Damien L-G <dalg24@gmail.com>

Differential Revision: https://reviews.llvm.org/D153783
2023-06-29 14:01:08 -06:00
Christian Trott
cfa096d9c9 [libc++][mdspan] Implement layout_right
This commit implements layout_right in support of C++23 mdspan
(https://wg21.link/p0009). layout_right is a layout mapping policy
whose index mapping corresponds to the memory layout of multidimensional
C-arrays, and is thus also referred to as the C-layout.

Co-authored-by: Damien L-G <dalg24@gmail.com>

Differential Revision: https://reviews.llvm.org/D151267
2023-06-29 10:12:17 -04:00
yronglin
9f6439f1c5 [libc++][ranges] Implement P2494R2 (Relaxing range adaptors to allow for move only types)
Implement P2494R2 `Relaxing range adaptors to allow for move only types`

https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2494r2.html#wording-ftm

According to the words in P2494R2, I haven't add new test for `drop_while_view`, `take_while_view` and `filter_view`, because these views has the requirement that the predicate is an `indirect_unary_predicate`, which requires that the predicate is `copy_constructible`, so they still can't accept move only types as predicate.

```
[P2483R0] also suggests future work to relax the requirements on the predicate types stored by standard views. This paper does not perform this relaxation, as the copy constructibility requirement is enshrined in the indirect callable concepts ([indirectcallable.indirectinvocable]). Thus, while this paper modifies the views that currently use copyable-box for user provided predicates, it only does so to apply the rename of the exposition-only type to movable-box; it does not change any of the constraints on those views. It does, however, relax the requirements on invocables accepted by the transform family of views, because those are not constrained using the indirect callable concepts.
```

Reviewed By: #libc, var-const

Differential Revision: https://reviews.llvm.org/D151629
2023-06-25 08:15:52 +08:00
Hristo Hristov
5f8e431597 [libc++][ranges] Addresses: LWG3719 - Directory iterators should be usable with default sentinel
Addresses:  LWG3719 - Directory iterators should be usable with default sentinel
https://wg21.link/LWG3719

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D153299
2023-06-24 17:54:47 +03:00
Mark de Wever
48abcf11ad [libc++][format] Adds formattable-with concept.
This change has a few additional effects:
- Abstract classes are now formattable.
- Volatile objects are no longer formattable.

Implements
- LWG3631 basic_format_arg(T&&) should use remove_cvref_t<T> throughout
- LWG3925 Concept formattable's definition is incorrect

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D152092
2023-06-21 08:05:33 +02:00
Mark de Wever
ffe0495105 [NFC][libc++] Addresses LWG3927.
Changes to preconditions have no impact on the library.

Implements
- LWG3927 Unclear preconditions for operator[] for sequence containers

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153286
2023-06-20 17:19:55 +02:00
Mark de Wever
946116fc05 [NFC][libc++] Addresses LWG3935.
Note libc++ implemented this in its initial version.

Implements
- LWG3935 template<class X> constexpr complex& operator=(const complex<X>&) has no specification

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D153287
2023-06-20 17:16:06 +02:00
Mark de Wever
f805c799bf [libc++] "Implements" new SI prefixis.
Like yocto, zepto, zetta, and yotta. The new prefixes quecto, ronto,
ronna, and quetta can't be implemented in a intmax_t. So their
implementation does nothing.

Implements
- P2734R0 Adding the new SI prefixes

Depends on D153192

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153200
2023-06-19 17:04:35 +02:00
Mark de Wever
cdcfc5ec9b [libc++][regex] Removes operator!=.
Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: #libc, H-G-Hristov, philnik

Differential Revision: https://reviews.llvm.org/D153222
2023-06-19 17:01:56 +02:00
Mark de Wever
3f05d044f4 [libc++] Update status after Varna meeting.
This updates:
- The status tables
- Feature test macros
- New headers for modules
The latter avoids forgetting about modules when implementing the feature
in a new header.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153192
2023-06-19 16:55:30 +02:00
Hristo Hristov
0dda8691b2 [libc++][ranges] Mark views::stride in progress 2023-06-19 11:48:12 +03:00
Hristo Hristov
4f7680ceda [libc++][spaceship][NFC] P1612R2: Mark remove operator!= from "Ranges Library" items as "Complete"
Marked already implemented parts of P1612R2 as "Complete":
- `ranges::iota_view::iterator` https://reviews.llvm.org/D110774
- `iota_view::sentinel` https://reviews.llvm.org/D107396
- `filter_view::iterator` https://reviews.llvm.org/D109086
- `filter_view::sentinel` https://reviews.llvm.org/D109086
- `ranges::transform_view::iterator` https://reviews.llvm.org/D110774
- `transform_view::sentinel` https://reviews.llvm.org/D103056
- `take_view::sentinel` https://reviews.llvm.org/D123600
- `join_view::iterator` https://reviews.llvm.org/D107671
- `join_view::sentinel ` https://reviews.llvm.org/D107671
- `split_view::outer_iterator` https://reviews.llvm.org/D142063
- `split_view::inner_iterator` https://reviews.llvm.org/D142063

Note these operators were added and removed in C++20.

Reviewed By: Mordante, #libc

Differential Revision: https://reviews.llvm.org/D152721
2023-06-18 21:18:40 +03:00
Mark de Wever
b72a7cb320 [libc++][doc] Move not yet adopted issues to C++26.
The development of C++23 is complete, so these issues will be adopted in
C++26 (or later).

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D153053
2023-06-16 17:39:08 +02:00
Nikolas Klauser
3a7876f6e2 [libc++][PSTL] Implement std::is_partitioned
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D152853
2023-06-15 11:23:07 -07:00
Hristo Hristov
e7e36d56d6 [libc++][ranges][NFC] Status page: Adds views::enumerate 2023-06-15 00:53:15 +03:00
Hristo Hristov
9838dd7f76 [libc++][spaceship][NFC] P1614R2: Status page - mark header synopsis sections as "Complete"
Header synospis sections of P1614R2 are implemented by other items usually. For completeness, let's mark some of them as "Complete".

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152775
2023-06-15 00:28:10 +03:00
Nikolas Klauser
cd916108b4 [libc++][PSTL] Implement std::generate{,_n}
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D152581
2023-06-13 07:55:06 -07:00
Hristo Hristov
7928ac4e6a [libc++][spaceship] P1612R2: Removed operator!= from locale
Implemented parts of P1612R2:
- Removed `operator!=` from `locale`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152654
2023-06-13 07:47:13 +03:00
Hristo Hristov
5a53323d2c [libc++][spaceship][NFC] P1612R2: Mark some items "remove operator!= from *_iterator" as "Complete"
Several parts of P1612R2 are already implemented:
- `common_iterator` (new in C++20) https://reviews.llvm.org/D103335
- `unreachable_sentinel_t` (new in C++20) https://reviews.llvm.org/D107920
- `istream_iterator` (removed) https://reviews.llvm.org/D119620
- `istreambuf_iterator` (removed) https://reviews.llvm.org/D119620

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152656
2023-06-13 07:44:01 +03:00
Nikolas Klauser
ab028d8006 [libc++][PSTL] Update papers and add a status page for the algorithms
Reviewed By: #libc, ldionne

Spies: libcxx-commits, mgrang, arphaman

Differential Revision: https://reviews.llvm.org/D152578
2023-06-12 16:46:06 -07:00
Hristo Hristov
0029ad89e8 [libc++][spaceship] P1614R2: Removed operator!= from weekdays
Implements parts of P1614R2. Removed `operator!=` from:
- `weekday`
- `weekday_indexed`
- `weekday_last`
- `month_weekday`
- `month_weekday_last`
- `year_month_weekday`
- `year_month_weekday_last`

Note these operators were added and removed in C++20.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152699
2023-06-12 22:22:22 +03:00
Hristo Hristov
a9e0321ffe [libc++][spaceship] P1614R2: Added operator== to file_status
Implemented parts of P1614R2:
- Added `operator==` to `file_status`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152647
2023-06-12 19:53:50 +03:00
Hristo Hristov
8cf3c2920d [libc++][spaceship] P1614R2: Removed operator!= from scoped_allocator_adaptor
Implements parts of P1614R2
- Removed `operator!=` from `scoped_allocator_adaptor`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152678
2023-06-12 19:51:27 +03:00
Hristo Hristov
9a6ca67397 [libc++][spaceship] P1614R2: Removed operator!= from functional
Implements parts of P1614R2:
- Removed `operator!=` from `functional`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152704
2023-06-12 19:48:42 +03:00
Hristo Hristov
d1ef99fe1c [libc++][spaceship] P1614R2: Removed global operator!= from allocator
Implements parts of P1614R2:
- Removed global `operator!=` from `allocator`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152612
2023-06-12 09:41:56 +03:00
Hristo Hristov
7c96cd35bf [libc++][spaceship] P1612R2: Removed operator!= from bitset
Implements parts of P1612R2:
- Removed `operator!=` from `bitset`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152611
2023-06-12 09:26:51 +03:00
Hristo Hristov
3d74398bd3 [libc++][spaceship] P1614R2: Removed operator!= from unordered_map, unordered_multimap, __hash_map_iterator
Implements parts of P1614R2:
- Removed ops from `unordered_map`
- Removed ops from `unordered_multimap`
- Removed ops from `__hash_map_iterator`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152642
2023-06-12 09:23:36 +03:00
Hristo Hristov
bfd6e4dd2d [libc++][spaceship] P1614R2: Removed ops from unordered_multiset, unordered_set
Implements parts of P1614R2:
- Removed ops from `unordered_multiset`,
- Removed ops from `unordered_set`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152643
2023-06-11 21:31:24 +03:00
Hristo Hristov
be45fe5d85 [libc++][spaceship] P1614R2: Removed ops from complex
Implements parts of P1614R2:
- Removed ops from `complex`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152615
2023-06-11 19:52:02 +03:00
Hristo Hristov
f877e88c35 [libc++][spaceship] P1614R2: Added operator== to slice
Implements parts of P1614R2:
- Added `operator==` to `slice`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152617
2023-06-11 19:50:31 +03:00
Hristo Hristov
6c34aab3ff [libc++][spaceship] P1614R2: Removed ops from memory_resource, polymorphic_allocator
Implements parts of P1614R2
- Removed ops from `memory_resource`
- Removed ops from `polymorphic_allocator`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152629
2023-06-11 19:49:35 +03:00
Hristo Hristov
211efbb198 [libc++][spaceship][NFC] Updates SpaceshipProjects.csv with full details from P1614R2
Adds the remaining sections from [[ https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html | P1614R2 ]]
Some entries were reordered for easier tracking.
The items in the table match [[ https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html | P1614R2 ]]'s sections strictly.

Reviewed By: Mordante, #libc

Differential Revision: https://reviews.llvm.org/D152297
2023-06-10 22:09:58 +03:00
Hristo Hristov
ca7a041626 [libc++][spaceship] Implement operator<=> for stack
Depends on D146066

Depends on D132268

Implements parts of P1614R2 `operator<=>` for `stack`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D146094
2023-06-10 07:37:36 +03:00
Hristo Hristov
55ec808a88 [libc++][spaceship] Implement operator<=> for vector
Implements part of P1614R2 "The Mothership has Landed"

Depends on D150188

Reviewed By: Mordante, #libc

Differential Revision: https://reviews.llvm.org/D132268
2023-06-10 06:53:05 +03:00
Hristo Hristov
172d990c03 [libc++][spaceship] Implement operator<=> for queue
Implements parts of P1614R2 `operator<=>` for `queue`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D146066
2023-06-06 08:41:56 +03:00
Hui
b77e50e6ae [libc++] Implement stop_token
Implement stop_token
http://eel.is/c++draft/thread.stoptoken
2023-06-05 15:10:36 +01:00