621 Commits

Author SHA1 Message Date
Louis Dionne
b699a9ba11
[libc++] Update status page after the Tokyo meeting (#87395) 2024-04-03 08:21:11 -04:00
yronglin
31a9a4b837
[libc++] Implement LWG3528 (make_from_tuple can perform (the equivalent of) a C-style cast) (#85263)
Implement [LWG3528](https://wg21.link/LWG3528).
Based on LWG3528(https://wg21.link/LWG3528) and
http://eel.is/c++draft/description#structure.requirements-9, the
standard allows to impose requirements, we constraint
`std::make_from_tuple` to make `std::make_from_tuple` SFINAE friendly
and also avoid worse diagnostic messages. We still keep the constraints
of `std::__make_from_tuple_impl` so that `std::__make_from_tuple_impl`
will have the same advantages when used alone.

---------

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-03-22 20:45:17 +08:00
Mark de Wever
8779edb8b3
[libc++] Deprecates std::errc constants. (#80542)
Implements:
- LWG3869 Deprecate std::errc constants related to UNIX STREAMS
2024-03-21 12:14:24 +01:00
Xiaoyang Liu
cf09b7dec4
[libc++][ranges] LWG3715: view_interface::empty is overconstrained (#85004)
## Abstract

This pull request implements LWG3715: `view_interface::empty` is
overconstrained. Here is an example similar to those described in the
report, which compiles with `-stdlib=libstdc++` but failed to compile
with `-stdlib=libc++`:

```cpp
// https://godbolt.org/z/EWEoTzah3
std::istringstream input("1 2 3 4 5");
auto i = std::views::istream<int>(input);
auto r = std::views::counted(i.begin(), 4) | std::views::take(2);
assert(!r.empty());
```

## Reference

- [Draft C++ Standard:
[view.interface.general]](https://eel.is/c++draft/view.interface.general)
- [LWG3715](https://wg21.link/LWG3715)
2024-03-20 09:47:40 +01:00
yronglin
c5818c3abc
[libc++][NFC] Update LWG3477(Simplify constraints for semiregular-box) status (#85399)
Since we implemented `copyable-box` in
(https://reviews.llvm.org/D102135,
6829db727e),
this issue got addressed.

---------

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-03-17 23:03:55 +08:00
Jakub Mazurkiewicz
12978b3e23
[libc++] P2602R2 Poison Pills are Too Toxic (#74534)
Implements [P2602R2 Poison Pills are Too
Toxic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html)
as a DR in C++20 mode.
2024-03-16 12:16:36 +00:00
yronglin
3ed8f19cd0
[libc++][NFC] Mark LWG3772 as implemented (#85108)
[LWG3772](https://wg21.link/LWG3772) already implemented with
https://reviews.llvm.org/D141699 .

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-03-15 07:02:59 +08:00
Mark de Wever
e1da74d916
[libc++][format] Updates LWG3462 status. (#80550)
The specifications of format had a contradiction, libc++ always
implemented the code as-if LWG3462 has been done; the contradiction was
a bit hard to spot.

Marks as nothing to do:
- LWG3462 §[formatter.requirements]: Formatter requirements forbid use
of fc.arg()
2024-03-09 12:35:26 +01:00
Mark de Wever
914f754876
[libc++][format] Update LWG3701 status. (#80545)
The issue has been resolved in https://reviews.llvm.org/D121138 since it
was needed to implement format. This updates the status of the LWG-issue
filed for this review.

Marks as complete:
- LWG3701 Make formatter<remove_cvref_t<const charT[N]>, charT>
requirement explicit
2024-03-09 12:32:57 +01:00
Hristo Hristov
716a23c412
[libc++][NFC] Status page: fix minor formatting issues (#83969)
Fixes several minor formatting issues and omissions I introduced on the
status pages in previous patches.
2024-03-06 14:09:26 +02:00
Hristo Hristov
80f9458cf3
[libc++][sstream] P2495R3: Interfacing stringstreams with string_view (#80552)
Implements P2495R3 <https://wg21.link/P2495R3>
- https://eel.is/c++draft/version.syn#headerref:%3csstream%3e
- https://eel.is/c++draft/stringbuf
- https://eel.is/c++draft/stringbuf.general
- https://eel.is/c++draft/stringbuf.cons
- https://eel.is/c++draft/stringbuf.members
- https://eel.is/c++draft/istringstream
- https://eel.is/c++draft/istringstream.general
- https://eel.is/c++draft/istringstream.cons
- https://eel.is/c++draft/istringstream.members
- https://eel.is/c++draft/ostringstream
- https://eel.is/c++draft/ostringstream.general
- https://eel.is/c++draft/ostringstream.cons
- https://eel.is/c++draft/ostringstream.members
- https://eel.is/c++draft/stringstream
- https://eel.is/c++draft/stringstream.general
- https://eel.is/c++draft/stringstream.cons
- https://eel.is/c++draft/stringstream.members

References:
- https://eel.is/c++draft/string.streams
2024-03-05 08:49:49 +02:00
ZijunZhaoCCK
7d7d4752a8
[libc++] Set feature test macros __cpp_lib_ranges_contains and__cpp_lib_ranges_starts_ends_with (#81816)
ranges::contains: fdd089b50063
ranges::starts_with: 205175578e0d
ranges::ends_with: 0218ea4aaa54

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2024-02-29 16:06:32 -08:00
Hristo Hristov
2ea5d167ae
[libc++][complex] P2819R2: Add tuple protocol to complex (#79744)
Implements: P2819R2 <https://wg21.link/P2819R2>
- https://eel.is/c++draft/utilities#concept:tuple-like
- https://eel.is/c++draft/complex.syn
- https://eel.is/c++draft/complex.tuple

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-02-19 09:56:06 +02:00
Mark de Wever
d332d88b91
[libc++][chrono] Loads tzdata.zi in tzdb. (#74928)
This implements the loading of the tzdata.zi file and store its contents
in the tzdb struct.

This adds all required members except:
- the leap seconds,
- the locate_zone, and
- current_zone.

The class time_zone is incomplete and only contains the parts needed for
storing the parsed data.

The class time_zone_link is fully implemented including its non-member
functions.

Implements parts of:
- P0355 Extending <chrono> to Calendars and Time Zones
- P1614 The Mothership has Landed

Implements:
- P1982 Rename link to time_zone_link
2024-02-17 14:28:01 +01:00
ZijunZhaoCCK
a6b846ae1e
[libc++][ranges] Implement ranges::contains_subrange (#66963) 2024-02-13 15:42:37 -08:00
Mark de Wever
7d9540ea96
[libc++][chrono] Implements duration Rep constraints. (#80539)
Applies LWG3050 to the constraints of operator*, operator/, and
operator%. The changes to the constructor were done in
https://reviews.llvm.org/D118902, but that patch did not identify the
related LWG-issue, and only adjusted the constructor to the wording in
the Standard.

Implements:
- LWG 3050: Conversion specification problem in chrono::duration
constructor

---------

Co-authored-by: h-vetinari <h.vetinari@gmx.com>
2024-02-10 14:21:57 +01:00
Mark de Wever
04f99bec9a
[libc++][doc] Updates LWG3346 status. (#80536)
The issue addresses an obvious wording issue. Implementing the
constructors as specified in the synposis, as libc++ did, already
implements the fixed behaviour.

Updates:
- LWG3346 pair and tuple copy and move constructor have backwards
specification
2024-02-05 12:15:55 -05:00
Hristo Hristov
7d78ccf7d5
[libc++][memory] P2652R2: Disallow Specialization of allocator_traits (#79978)
Implements P2652R2 <https://wg21.link/P2652R2>:
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-02-01 12:31:25 +01:00
Hristo Hristov
27e67cdb31
Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (#79032)
Deleted the offending test case.


`libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp`
lines: 134-135:   
>   test<Context, bool, long>(true, 192812079084L);
     test<Context, bool, long>(false, 192812079084L);
     
 Relands: https://github.com/llvm/llvm-project/pull/76449
Reverted in:
02f95b7751

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-29 20:57:12 +02:00
Petr Hosek
02f95b7751 Revert "[libc++][format] P2637R3: Member visit (std::basic_format_arg) (#76449)"
This reverts commit 7d9b5aa65b09126031e1c2903605a7d34aea4bc1 since
std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
is failing on Windows when building with Clang-cl.
2024-01-22 17:23:05 +00:00
Hristo Hristov
03c19e91e8
[libc++][numeric] P0543R3: Saturation arithmetic (#77967)
Implements: https://wg21.link/P0543R3
- https://eel.is/c++draft/numeric.sat

Additional references:
- Division: https://eel.is/c++draft/expr.mul#4
- Arithmetic conversions: https://eel.is/c++draft/expr.arith.conv#1
- Clang builtins:
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions

Depends on: https://github.com/llvm/llvm-project/pull/78086

---------

Co-authored-by: Zingam <zingam@outlook.com>
Co-authored-by: Mark de Wever <zar-rpg@xs4all.nl>
2024-01-22 06:57:45 +02:00
Mark de Wever
30d6806a08
[libc++][doc] Update the release notes for LLVM 18 (#78324)
This is a preparation for the upcoming LLVM 18 release.
2024-01-21 19:48:33 +01:00
Hristo Hristov
7d9b5aa65b
[libc++][format] P2637R3: Member visit (std::basic_format_arg) (#76449)
Implements parts of: `P2637R3` https://wg21.link/P2637R3
(https://eel.is/c++draft/variant.visit)

Implements:
`basic_format_arg.visit()`
`basic_format_arg.visit<R>()`
Deprecates:
`std::visit_format_arg()`

The tests are as close as possible to the non-member function tests.

To land after: https://github.com/llvm/llvm-project/pull/76447,
https://github.com/llvm/llvm-project/pull/76268

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-21 12:30:25 +02:00
Hristo Hristov
38b5f2edfc
[libc++][spaceship][NFC] Status page update (#78894)
Co-authored-by: Zingam <zingam@outlook.com>
2024-01-21 12:27:16 +02:00
Hristo Hristov
3412bc7658
[libc++][variant] P2637R3: Member visit (std::variant) (#76447)
Implements parts of: `P2637R3` https://wg21.link/P2637R3
(https://eel.is/c++draft/variant.visit)

Implements:
`variant.visit()`
`variant.visit<R>()`

The tests are as close as possible to the non-member function.

To land after: https://github.com/llvm/llvm-project/pull/76268

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-21 07:16:51 +02:00
ZhangYin
6bb5c989bd
[libc++] <experimental/simd> Add load constructor for class simd/simd_mask (#76610) 2024-01-21 12:48:30 +08:00
Hristo Hristov
34feb2263e
[libc++][spaceship][NFC] Status page update: *libc++* Spaceship Operator Status (operator<=>)¶ (#78832)
Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 08:33:00 +02:00
Hristo Hristov
dbbeee6b83
[libc++][span] P2447R4: std::span over an initializer list (#78157)
Implements: https://wg21.link/P2447R6
- https://eel.is/c++draft/span.syn
- https://eel.is/c++draft/span.overview
- https://eel.is/c++draft/span.cons
- https://eel.is/c++draft/diff

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 06:09:46 +02:00
Hristo Hristov
552f5549de
[libc++][any] LWG3305: any_cast<void> (#78215)
Implements: https://wg21.link/LWG3305
- https://eel.is/c++draft/any.nonmembers

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 06:08:24 +02:00
Hristo Hristov
ed276dff46
[libc++][memory] P2868R1: Removing deprecated typedef std::allocator::is_always_equal (#78562)
Implements:
- https://wg21.link/P2868R1
- https://wg21.link/LWG3170

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 06:07:19 +02:00
Twice
7ded34576f
[libc++] Implement LWG3940: std::expected<void, E>::value() also needs E to be copy constructible (#71819)
This patch includes the fix for
[LWG3940](https://cplusplus.github.io/LWG/issue3940)
(`std::expected<void, E>::value()` also needs `E` to be copy
constructible)
2024-01-19 10:06:11 +00:00
Mark de Wever
d29297239f
[libc++] Implements P2517R1. (#77239)
As pointed out by @Zingam the paper was implemented in libc++ as an
extension. This patch does the bookkeeping. The inital release version
is based on historical release dates.

Completes:
- Add a conditional noexcept specification to std::apply
2024-01-09 19:11:40 +01:00
Mark de Wever
01410103a6
[libc++][doc] Marks LWG3257 as complete (#77237)
The macros were already updated
- __cpp_lib_string_view in 466df1718e41fe2fca6ce6bd98c01b18f42c05e4
- __cpp_lib_array_constexpr in 77b9abfc8e89ca627e4f9a1cc206bea131db6db1

Based on the dates of the commit and that
 P0858 "Constexpr iterator requirements"
was completed in LLVM 12, set this issue as completed in the same
version.

Completes
- LWG3257 Missing feature testing macro update from P0858
2024-01-08 17:24:42 +01:00
Hristo Hristov
92e243173c
Reapply "[libc++][streams] P1759R6: Native handles and file streams" (#77190)
Fixes build on Windows in C++26 mode.

Reverted in:
40c07b559a
Original PR: https://github.com/llvm/llvm-project/pull/76632

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-07 18:01:03 +02:00
Haowei Wu
40c07b559a Revert "[libc++][streams] P1759R6: Native handles and file streams (#76632)"
This reverts commit 255f95a40377677dd762df5a1aa65bcbb4f75c79, which
contains a breaking libcxx test on Windows when using C++26
2024-01-05 17:23:40 -08:00
Hristo Hristov
255f95a403
[libc++][streams] P1759R6: Native handles and file streams (#76632)
Implements: `P1759R6` https://wg21.link/P1759R6

- https://eel.is/c++draft/filebuf
- https://eel.is/c++draft/ifstream
- https://eel.is/c++draft/ofstream
- https://eel.is/c++draft/fstream

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-05 11:42:08 +02:00
Hristo Hristov
a72ab9c14d
[libc++][span] P2821R5: span.at() (#74994)
- Implements: [P2821R5: span.at()](https://wg21.link/P2821R5)
  (https://eel.is/c++draft/views.contiguous#views.span)
- Cleaned up `span.operator[]` test

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-05 11:41:22 +02:00
Mark de Wever
81cedac8f6
[libc++] Deprecates and removes shared_ptr::unqiue. (#76576)
The status table incorrectly marks P0521R0 as nothing to do. This is not
correct the function should be deprecated.
During our latest monthly meeting we argreed to remove the
_LIBCPP_ENABLE_CXXyy_REMOVED_FEATURES macros, therefore the new macro is
not
added to that global list.

Implements
- P0521R0 Proposed Resolution for CA 14 (shared_ptr use_count/unique)

Implements parts of
- P0619R4 Reviewing Deprecated Facilities of C++17 for C++20

---------

Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
2023-12-30 14:05:22 +01:00
Christopher Di Bella
3903438860
[libcxx] adds ranges::fold_left_with_iter and ranges::fold_left (#75259)
Notable things in this commit:

* refactors `__indirect_binary_left_foldable`, making it slightly
different (but equivalent) to _`indirect-binary-left-foldable`_, which
improves readability (a [patch to the Working Paper][patch] was made)
* omits `__cpo` namespace, since it is not required for implementing
niebloids (a cleanup should happen in 2024)
* puts tests ensuring invocable robustness and dangling correctness
inside the correctness testing to ensure that the algorithms' results
are still correct

[patch]: https://github.com/cplusplus/draft/pull/6734
2023-12-19 21:57:50 -08:00
Mark de Wever
2fd4084fca
[libc++][print] Adds ostream overloads. (#73262)
Finishes implementation of
- P2093R14 Formatted output
- P2539R4 Should the output of std::print to a terminal be synchronized
with the underlying stream?

Differential Revision: https://reviews.llvm.org/D156609
2023-12-19 19:32:17 +01:00
Hristo Hristov
e564d246b2
[libc++][spaceship][NFC] Status page - added papers (#75043)
Added C++20 papers to Spaceship status page

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2023-12-16 14:17:28 +01:00
Jakub Mazurkiewicz
6a66467499
[libc++] P2770R0: Stashing stashing iterators for proper flattening (#66033)
- Partially implements P2770R0 (http://wg21.link/p2770)
- Fixes https://wg21.link/LWG3698, https://wg21.link/LWG3700, and https://wg21.link/LWG3791
- join_with_view hasn't been done yet since this type isn't implemented yet
- Rename tuple test directory to match the standard (which changed in P2770R0)
- Rename join_view test directory to match the standard
2023-12-12 09:45:14 -05:00
Mark de Wever
e3f154d873
[libc++] Implements Runtime format strings. (#73353)
This change requires quite a number of changes in the tests; this is not
code I expect people to use in the wild. So I don't expect breakage for
users.

Implements:
- P2905R2 Runtime format strings, as a Defect Report
2023-12-09 12:32:17 +01:00
Jakub Mazurkiewicz
a7993faf0c
[libc++] Mark P2017R1 as complete (#74484)
[P2017R1](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html#wording)
appears to have been implemented in LLVM 16.0:
https://godbolt.org/z/GbcT4rjcd.
2023-12-05 17:14:35 +01:00
Mark de Wever
16b8c9608f
[libc++][format] Fixes formatting code units as integers. (#73396)
This paper was voted in as a DR, so it's retroactively enabled back to
C++20; the C++ version that introduced std::format.

Implements:
- P2909R4 Fix formatting of code units as integers (Dude, where’s my
``char``?)
2023-11-29 17:55:09 +01:00
Nikolas Klauser
ed27a4edb0
[libc++][PSTL] Implement std::equal (#72448)
Differential Revision: https://reviews.llvm.org/D157131

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2023-11-28 16:02:18 -05:00
h-vetinari
80403e9fee
[libc++] fix some inconsistencies on libcxx status pages (#73471)
Minor things I've noticed from looking at the pages. For the missing
space I actually searched for "``\\\s\w" to see where they were hiding.
2023-11-27 10:14:18 -05:00
Mark de Wever
494c9e5f59
[libc++] Removes basic_string::reserve(). (#73354)
Implements:
- P2870R3 Remove basic_string::reserve()

---------

Co-authored-by: philnik777 <nikolasklauser@berlin.de>
2023-11-25 13:56:40 +01:00
Mark de Wever
233e7c5de2
[libc++] Removes codecvt. (#72496)
Implements:
- P2871R3 Remove Deprecated Unicode Conversion Facets from C++26
2023-11-24 17:34:30 +01:00
Mark de Wever
92d9f232dd
[libc++] Implements Runtime format strings II. (#72543)
Implements
- P2918R2 Runtime format strings II
2023-11-24 17:30:33 +01:00