710 Commits

Author SHA1 Message Date
ZhangYin
812ae91d54
[libc++] <experimental/simd> Add ++/-- operators for simd reference (#88091) 2024-08-14 15:30:17 +08:00
Louis Dionne
99c5615f5f [libc++][NFC] Add missing separators in status-tracking CSV files 2024-08-13 17:01:21 -04:00
Louis Dionne
e80bc77774 [libc++] Normalize how we track the meeting at which a paper of LWG issue was voted
This uses the same values as we use in the Github project that tracks
Standards conformance.
2024-08-13 16:58:24 -04:00
Xiaoyang Liu
d9caea18f9
[libc++][ranges] LWG3564: transform_view::iterator<true>::value_type and iterator_category should use const F& (#91816)
## Introduction

This patch implements LWG3564:
`transform_view::iterator<true>::value_type` and `iterator_category`
should use `const F&`.

`transform_view`'s iterator currently obtained from a `const
transform_view` invoke the transformation function as `const`, but the
`value_type` and `iterator_category` determination uses non-`const`
`F&`.

## Reference

-
[[range.transform.iterator]](https://eel.is/c++draft/range.transform.iterator)
- [LWG3564](https://cplusplus.github.io/LWG/issue3564)
2024-08-12 19:30:47 +02:00
Mark de Wever
4dee6411e0
[libc++] Implements LWG3130. (#101889)
This adds addressof at the required places in [input.output]. Some of
the new tests failed since string used operator& internally. These have
been fixed too.

Note the new fstream tests perform output to a basic_string instead of a
double. Using a double requires num_get specialization

num_get<CharT, istreambuf_iterator<CharT,
char_traits_operator_hijacker<CharT>>

This facet is not present in the locale database so the conversion would
fail due to a missing locale facet. Using basic_string avoids using the
locale.

As a drive-by fixes several bugs in the ofstream.cons tests. These
tested ifstream instead of ofstream with an open mode.

Implements:
- LWG3130 [input.output] needs many addressof

Closes #100246.
2024-08-06 19:47:56 +02:00
h-vetinari
0edafc461f
[libc++] mark P0645 as complete (#101852)
Now that #98275 has been merged, the footnote for P0645 has become
outdated. This updates the status information.
2024-08-04 15:59:53 +02:00
Mark de Wever
bfe09685d7
[NFC][libc++][exceptions] Adds tests for LWG3112. (#100881)
The tests kept being based on std::string instead of std::string_view to
allow testing with older C++ dialects.

Adds tests for:
- LWG3112 system_error and filesystem_error constructors taking a string
may not be able to meet their postconditions
2024-08-04 15:49:54 +02:00
ZhangYin
899055f20b
[libc++] <experimental/simd> Add compound assignment operators for simd reference (#86761) 2024-08-04 10:16:56 +08:00
Louis Dionne
39c7dc7207 [libc++][NFC] More consistency fixes to the CSV entries
- Update note for P0156 which was reverted in Kona, to avoid unusual status.
- Add the LWG issue number for an old C++14 NB comment.
- Fix broken link for LWG2118
- Capitalize paper numbers and links consistently
- Remove weird status '* *' which was likely added by mistake
2024-08-02 11:49:27 -04:00
Louis Dionne
d40fa2c82a [libc++][NFC] Fix typos in the status-tracking CSV introduced by recent changes 2024-08-02 09:43:12 -04:00
Louis Dionne
b6262880b3
[libc++] Consistency fixes for the CSV status files (#101572)
- Make sure we always have the same number of entries. In particular, I
  dropped the "Group" entry that was tracked for papers but not for LWG
  issues, since I don't think that added much. The group is already
  tracked on the paper itself.
- Add "Label" row to all the CSV files.

This is mechanical, but it's necessary if we want to process our CSV
files uniformly, for example to synchronize their state with Github
issues.
2024-08-02 09:13:20 -04:00
Louis Dionne
64946fdaf9 [libc++][NFC] Fix inconsistent quoting and spacing in our CSV files
There were a few places where we didn't properly quote entries in the
CSV status pages, or where we followed inconsistent spacing. This causes
issue when trying to synchronize status pages with Github issues.
2024-08-01 17:25:31 -04:00
Mark de Wever
d5a6ec1d4d
[libc++][stringbuf] Test and document LWG2995. (#100879)
As mentioned in the LWG issue libc++ has already implemented the
optimization. This adds tests and documents the implementation defined
behaviour.

Drive-by fixes an initialization.
2024-08-01 11:00:14 -04:00
A. Jiang
569d8ce11f
[libc++][docs] Remove misadded entry for P1937R2 from Cxx20Papers.csv (#100741)
P1937R2 only contains core language change and doesn't touch the library
at all.

Closes #100613.
2024-07-31 09:33:02 -04:00
Mark de Wever
442c33f3a3
[libc++][stdatomic.h] Implements LWG3671. (#99775)
Implements:
- LWG3671 atomic_fetch_xor missing from stdatomic.h
2024-07-30 19:32:35 +02:00
Mark de Wever
2711618214
[libc++][memory_resource] Implements LWG3683. (#100775)
The polymorphic_allocator was added in C++17.
This issue was filed in 2022 so well after C++20. This issue adds an
operator==.

Starting with C++20 this adds a compiler generated operator!=. To have
the same behaviour in C++17 and C++20 (and later) a manual operator!= is
defined in C++17.

Implements
- LWG3683 operator== for polymorphic_allocator cannot deduce template
argument in common cases
2024-07-28 12:22:19 +02:00
Mark de Wever
d2553a2be9
[libc++][doc] Updates the libc++ status page. (#100595)
- LWG3147 Definitions of "likely" and "unlikely" are likely to cause
problems Adjusts the requirements on programs using the Standard
library.

- LWG3328 Clarify that std::string is not good for UTF-8 Adds a
non-normative note, aimed at users of the Standard library.

- LWG3784 std.compat should not provide ::byte and its friends was
implemented during modules.

- LWG3062 Unnecessary decay_t in is_execution_policy_v should be
remove_cvref_t Was implemented while implementing parallel algorithms.

- LWG3362 Strike stop_source's operator!= The removed operator was never
implemented.

- LWG3616 LWG 3498 seems to miss the non-member swap for basic_syncbuf
This was implemented correctly from the start.

- LWG3199 istream >> bitset<0> fails This was implemented in
fc4486c2472b84384d4a31d2436a91bdb9b29792, might be in LLVM-9

- LWG3828 Sync intmax_t and uintmax_t with C2x Standardardized existing
practice.

- LWG3713 Sorted with respect to comparator (only) Wording issue in the
Standard.

- LWG3823 Unnecessary precondition for is_aggregate Changes the
preconditions

- LWG3826 Redundant specification [for overload of yield_value] Changes
a remark to a note

- LWG3203 span element access invalidation Update wording relevant for
users of the Standard library.
2024-07-26 18:33:51 +02:00
Mark de Wever
3ce6f68ee7
[libc++][spaceship] Marks P1614 as complete. (#99375)
Implements parts of:
- P1902R1 Missing feature-test macros 2017-2019

Completes:
- P1614R2 The Mothership has Landed

Fixes #100018
2024-07-25 18:37:36 +02:00
Mark de Wever
8d3252a898
[libc++][spaceship] Implements X::iterator container requirements. (#99343)
This implements the requirements for the container iterator requirements
for array, deque, vector, and `vector<bool>`.

Implements:
- LWG3352 strong_equality isn't a thing

Implements parts of:
- P1614R2 The Mothership has Landed

Fixes: https://github.com/llvm/llvm-project/issues/62486
2024-07-24 19:42:48 +02:00
Mark de Wever
e6388fea3e
[libc++][memory] Implements LWG3307. (#99776)
As a drive-by added a nodiscard test for allocate_at_least.

Implements
- LWG33307 std::allocator<void>().allocate(n)
2024-07-23 19:35:02 +02:00
Mark de Wever
6cea8189b0
[libc++][vector] Updates LWG3778 status. (#99818)
The work was done in a8ae392718313e64e2d7bc092b00f51476c074b2 which
implements parts of

  N4258: Cleaning-up noexcept in the Library

However that's paper Summary of Proposed Changes contains
  No change in vector<bool>

This patch updates the status and as a few NFC cleanups. The fixed
version is based on the release page and might be off.

Updates
- LWG3778 vector<bool> missing exception specifications
2024-07-23 19:33:18 +02:00
Mark de Wever
e9bb4e303b
[libc++][doc] Update the release notes for LLVM 19. (#99061)
This is a preparation for the upcoming LLVM 19 release.
2024-07-23 18:59:23 +02:00
nicole mazzuca
4189226236
[libc++] Update some C++23 statuses to "Nothing to do" or "Complete" (#99621)
- [P2160R1][] "Locks lock lockables"
- [P2212R2][] "Relax Requirements for `time_point::clock`"
- [P1675R2][] "`rethrow_exception` must be allowed to copy"
- [P2340R1][] "Clarifying the status of the 'C headers'"
- [P2460R2][] "Relax requirements on `wchar_t` to match existing
practices"

Are all papers that change wording without changing implementation
behaviour.

Additionally, [P2736R2][] "Referencing The Unicode Standard", is an
already complete paper in 19.0 (as of [LLVM-86543][])

[P2160R1]: https://wg21.link/p2160r1
[P2212R2]: https://wg21.link/p2212r2
[P1675R2]: https://wg21.link/p1675r2
[P2340R1]: https://wg21.link/p2340r1
[P2460R2]: https://wg21.link/p2460r2
[P2736R2]: https://wg21.link/p2736r2
[LLVM-86543]: https://github.com/llvm/llvm-project/pull/86543
2024-07-22 18:33:41 +02:00
Xiaoyang Liu
3d7622ea0b
[libc++][ranges] LWG3618: Unnecessary iter_move for transform_view::iterator (#91809)
## Introduction

This patch implements LWG3618: Unnecessary `iter_move` for
`transform_view::iterator`.

`transform_view`'s iterator currently specifies a customization point
for `iter_move`. This customization point does the same thing that the
default implementation would do, but its sole purpose is to ensure the
appropriate conditional `noexcept` specification.

## Reference

-
[[range.transform.iterator]](https://eel.is/c++draft/range.transform.iterator)
- [LWG3618](https://cplusplus.github.io/LWG/issue3618)
2024-07-22 18:32:37 +02:00
Mark de Wever
14ec4746cc
[libc++] Makes `unique_ptr operator*() noexcept. (#98047)
This implements
 - LWG2762  unique_ptr operator*() should be noexcept.

Differential Revision: https://reviews.llvm.org/D128214
2024-07-21 13:06:02 +02:00
Mark de Wever
afbfb16d29
[libc++][TZDB] Implements zoned_time formatters. (#98347)
Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
- P1361 Integration of chrono with text formatting
- P2372 Fixing locale handling in chrono formatters
2024-07-20 19:24:41 +02:00
PaulXiCao
af0d731b12
[libc++][math] Mathematical Special Functions: Hermite Polynomial (#89982)
Implementing the Hermite polynomials which are part of C++17's
mathematical special functions. The goal is to get early feedback which
will make implementing the other functions easier. Integration of
functions in chunks (e.g. `std::hermite` at first, then `std::laguerre`,
etc.) might make sense as well (also see note on boost.math below).

I started out from this abandoned merge request:
https://reviews.llvm.org/D58876 .

The C++23 standard defines them in-terms of `/* floating-point type */`
arguments. I have not looked into that.

Note, there is still an ongoing discussion on discourse whether
importing boost.math is an option.
2024-07-20 17:50:05 +02:00
nicole mazzuca
04760bfadb
[libc++][ranges] P1223R5: find_last (#99312)
Implements [P1223R5][] completely.

Includes an implementation of `find_last`, `find_last_if`, and
`find_last_if_not`.

[P1223R5]: https://wg21.link/p1223r5
2024-07-19 09:42:16 -07:00
Hristo Hristov
e475bb7ac3
[libc++][memory] P1132R8: out_ptr - a scalable output pointer abstraction (#73618)
Differential Revision: https://reviews.llvm.org/D150525

Implements:
- https://wg21.link/P1132R8 - `out_ptr` - a scalable output pointer
abstraction
- https://eel.is/c++draft/smartptr.adapt - 20.3.4 Smart pointer adaptors
- https://wg21.link/LWG3734 - Inconsistency in `inout_ptr` and `out_ptr`
for empty case
- https://wg21.link/LWG3897- `inout_ptr` will not update raw pointer to
0

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-07-19 06:38:02 +03:00
Hristo Hristov
cb3de24b5c
[libc++][iterator][ranges] P2997R1: Removing the common reference requirement from the indirectly invocable concepts (#98817)
Implements as DR against C++20: https://wg21.link/P2997R1

References:
- https://eel.is/c++draft/indirectcallable.indirectinvocable
- https://eel.is/c++draft/version.syn#header:%3cversion%3e

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-07-18 14:54:29 +03:00
Hristo Hristov
4a19be5d45
[libc++][strings] P2591R5: Concatenation of strings and string views (#88389)
Implemented: https://wg21.link/P2591R5
- https://eel.is/c++draft/string.syn
- https://eel.is/c++draft/string.op.plus

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-07-18 13:26:37 +03:00
Hristo Hristov
60b6f43ea1
[libc++][ranges] LWG4001: iota_view should provide empty (#79687)
Implements: https://wg21.link/LWG4001
- https://eel.is/c++draft/range.iota.view

---------

Co-authored-by: Zingam <zingam@outlook.com>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
2024-07-17 18:10:17 +03:00
Hristo Hristov
8ba9ed6825
[libc++][ranges] LWG4035: single_view should provide empty (#98371)
Implements: https://wg21.link/LWG4035

- https://eel.is/c++draft/range.single.view
2024-07-16 18:13:05 +03:00
Xiaoyang Liu
4e338dce4d
[libc++] P2389R2: dextents Index Type Parameter (#97393)
This patch implements P2389R2, which was adopted at the St. Louis meeting.
It builds upon previous enhancements from P2299R3, which introduced deduction
guides and the `dextents` alias template.
2024-07-15 11:23:34 -04:00
A. Jiang
ef8207b579
[libc++][docs] LWG3380 made the status of P1614R2 in [meta.trans.other] "Nothing To Do" (#98636)
The changes of https://wg21.link/p1614r2 in [meta.trans.other]
were exactly reverted by https://wg21.link/LWG3380.
2024-07-12 16:12:31 -04:00
Hristo Hristov
31c9c41873
[libc++][tuple][utility] P2968R2: Make std::ignore a first-class object (#97401)
Implements:  https://wg21.link/P2968R2

References:
- https://eel.is/c++draft/tuple.general
- https://eel.is/c++draft/tuple.syn
- https://eel.is/c++draft/tuple.creation
- https://github.com/cplusplus/draft/milestone/31
- https://github.com/cplusplus/draft/pull/7109
- https://github.com/cplusplus/papers/issues/1640
- https://cplusplus.github.io/LWG/issue2933
- https://cplusplus.github.io/LWG/issue3978

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-07-11 00:05:23 +03:00
Mark de Wever
2b1b4e3025
[libc++][TZDB] Implements zoned_time's operator==. (#95140)
Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
- P1614R2 The Mothership has Landed
2024-07-10 16:06:29 +02:00
Mark de Wever
e77b295ada
[libc++][TZDB] Adds zoned_time deduction guides. (#95139)
Completes
- LWG3232 Inconsistency in zoned_time  deduction guides
- LWG3294 zoned_time  deduction guides misinterprets stringchar*

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
2024-07-10 13:46:56 +02:00
h-vetinari
a37c35e807
[libc++] mark P0154 as implemented; fix column alignment issues (#97865)
AFAIU, P0154 support is complete as of
https://github.com/llvm/llvm-project/pull/89446
2024-07-10 08:31:07 +02:00
Mark de Wever
a1d73ace13
[libc++][TZDB] Finishes zoned_time constructors. (#95010)
Completes
- LWG3225 zoned_time converting constructor shall not be noexcept
- LWG3226 zoned_time constructor from string_view should accept
zoned_time<Duration2, TimeZonePtr2>

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
2024-07-09 20:15:49 +02:00
Mark de Wever
dda4184808
[libc++][TZDB] Adds basics of zoned_time class. (#94999)
This implements the class, its non-templated constructors and its
getters to verify the construction.

Completes
- LWG3224 zoned_time constructor from TimeZonePtr does not specify
initialization of tp_

Implements parts of:
- P0355 Extending chrono to Calendars and Time Zones
2024-07-09 20:14:40 +02:00
A. Jiang
ca055bbec7
[libc++][format] LWG4061: Should std::basic_format_context be default-constructible/copyable/movable? (#97251)
See [LWG4061](https://cplusplus.github.io/LWG/issue4061) and
[P3341R0](https://wg21.link/p3341r0). Effectively reverts commit
36ce0c3b1e581ca310ae7d0cbc6af002cc5d0251.


`libcxx/test/std/utilities/format/format.functions/bug_81590.compile.pass.cpp`
has a `format` function that unexpectedly takes the
`basic_format_context` by value, which is made ill-formed by LWG4061.
This PR changes the function to take the context by reference.
2024-07-09 12:23:50 +02:00
A. Jiang
96c9913332
[libc++][format] LWG4106: basic_format_args should not be default-constructible (#97250)
See [LWG4106](https://cplusplus.github.io/LWG/issue4106) and
[P3341R0](https://wg21.link/p3341r0).

The test coverage for the empty state of `basic_format_args` in
`get.pass.cpp` is to be completely removed, because the
non-default-constructibility is covered in `ctor.pass.cpp`.
2024-07-09 12:21:30 +02:00
Mark de Wever
2dadf8d7f5
[libc++] Update status after the St. Louis meeting. (#97951)
This updates:
- The status tables
- Feature test macros
- New headers for modules
2024-07-08 19:35:31 +02:00
Mark de Wever
093ddac68c
[libc++][chrono] Fixes leap seconds. (#90070)
While implementing the UTC clock it turns out that the implementation of
the leap seconds was not correct, it should store the individual value,
not the sum.

It also looks like LWG3359 has not been fully implemented.

Implements parts of:
- LWG3359 <chrono> leap second support should allow for negative leap
seconds
2024-07-04 20:45:15 +02:00
Hui
eaae63d8e1
"[libc++] Try again LWG3233 Broken requirements for shared_ptr converting constructors" (#96103)
Try it again. Use the approach suggested by Tim in the LWG thread :
using function default argument SFINAE

- Revert "[libc++] Revert LWG3233 Broken requirements for shared_ptr
converting constructors (#93071)"
- Revert "[libc++] Revert temporary attempt to implement LWG 4110
(#95263)"
- test for default_delete
- Revert "Revert "[libc++] Revert temporary attempt to implement LWG
4110 (#95263)""
- test for NULL
2024-06-26 07:47:39 +01:00
ZhangYin
6ec1ddfd72
[libc++] <experimental/simd> Add swap functions of simd reference (#86478) 2024-06-23 12:51:02 +08:00
Louis Dionne
e7d563501f [libc++] Revert LWG3223 Broken requirements for shared_ptr converting constructors (#93071)
This reverts commit d868f0970, which was shown to break some code and we
don't know yet whether the code should be valid or not. Reverting until
we've had time to figure it out next week.
2024-06-14 14:41:47 -04:00
Louis Dionne
a66e2a1988
[libc++] Revert temporary attempt to implement LWG 4110 (#95263)
When I filed LWG4110 after the discussion in #93071, I thought it was
going to be a straightforward fix. It turns out that it isn't, so we
should stay in the state where libc++ is Standards conforming even if
that state leads to some reasonable code being rejected by the library.
Once WG21 figures out what to do with this issue and votes on it, we'll
implement it through our normal means.

This reverts f638f7b6a7c2 and 16f2aa1a2ddf.
2024-06-14 14:34:56 -04:00
Mark de Wever
759fb590da
[libc++][modules] Mark as implemented. (#90091)
The feature has been implemented in LLVM 18 as an experimental feature.
This marks the paper as complete and sets the feature-test macro.

Implements
- P2465R3 Standard Library Modules std and std.compat

Fixes: https://github.com/llvm/llvm-project/issues/89579
2024-06-12 19:01:27 +02:00