809 Commits

Author SHA1 Message Date
Hui
d7a24d30f6
[libc++] Implement ranges::shift_right (#177847)
Implement the `ranges::shift_right` algorithm from
[P2440R1](https://wg21.link/P2440R1).

Fixes #134062
Fixes #105184
2026-02-14 17:34:44 +00:00
Nhat Nguyen
9a60b2fa0c
[libc++] LWG4012: common_view::begin/end are missing the simple-view check (#153674)
close #105320
2026-02-09 09:17:30 +08:00
Peng Xie
c3564b09f7
[libc++] Update the status for lwg-3143 (#116971)
Current implementation uses the larger one either requested bytes or
growth factor multiply previous buffer size.

This patch updates the status of LWG 3143 and adds a libc++-specific
test case to test geometric progression.

Close #104258
2026-01-26 16:17:40 -05:00
xiaoyang-sde
9311996261
[libc++][ranges] implement ranges::shift_left (#83231)
Implement the `ranges::shift_left` algorithm from
[P2440R1](https://wg21.link/P2440R1).

Closes: #134061

---------

Co-authored-by: Hui Xie <hui.xie1990@gmail.com>
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2026-01-25 10:35:43 +00:00
Hui
985d75a57a
[libc++] define FTM __cpp_lib_ranges_zip (#176569)
P2321R2 has been implemented in various PRs. Based on the discussion
in #105169, the last bit in iterator.concept.winc doesn't require
any changes, so we can actually mark this as done.

Fixes #105169
2026-01-19 15:18:57 -05:00
Louis Dionne
d188a7b068
[libc++] Remove CSV tracking for PSTL (#175797)
This is now tracked in Github directly: #99938
2026-01-14 13:27:51 -05:00
Louis Dionne
e40101bc2d
[libc++] Improve the script to manage libc++ conformance issues (#172905)
The previous script was fairly inflexible. This patch refactors the
script into a tool that can be used in various ways to manage the
conformance-tracking bits of libc++. This should make it possible to
synchronize the CSV status files, but also to find Github issues that
aren't linked to the 'C++ Standards Conformance' project, to create
missing issues more easily, etc.
2026-01-13 11:57:53 -05:00
eiytoq
bfd139dacd
[libc++] Fix LWG 4265: std::midpoint should not accept const bool (#174579)
Fixes: #171324

---------

Co-authored-by: Hristo Hristov <hghristov.rmm@gmail.com>
2026-01-09 07:26:38 +08:00
William Tran-Viet
7bc05a8829
[libc++] Resolve LWG4439 and LWG4300 (#174257)
Resolves #171340 implemented in #155202

Resolves #171402 implemented in #155202

- Add `swap` test for `optional<T&>` to ensure an ADL-found swap isn't
selected.
- Drive-by: Update documentation for LWG4300 since it's already
completed
2026-01-03 23:28:11 +08:00
A. Jiang
465d11e1ce
[libc++] LWG3627: Inconsistent specifications for std::make_optional overloads (#173466)
It should be sufficient to use `is_constructible_v<decay_t<T>, T>` in
the constraints, because the `const optional<U>&`/`optional<U>&&`
constructors are sufficiently constrained.

Drive-by: Refactor
`libcxx/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp`
to run more cases during constant evaluation.
2026-01-03 19:50:51 +08:00
Rafail Shakhin ogly
ec7b63771c
[libc++][chrono] P2592R3: Hashing for chrono (#165132) 2026-01-03 10:32:14 +08:00
William Tran-Viet
07adecfef4
[libc++] Resolve LWG4370 (#174062)
Resolves #171364

- Implement [proposed resolution of LWG4370](https://wg21.link/LWG4370)
- Add corresponding compile test
2026-01-01 20:04:57 +08:00
William Tran-Viet
d1f65cd584
[libc++] Resolve LWG4308, correct iterator availability for optional<T&> (#173948)
Resolves #171345

Implements [proposed resolution for
LWG4308](https://cplusplus.github.io/LWG/issue4308) and removes
`const_iterator` from `optional<T&>`, which was missed.

- Constrains iterator to only be available if T is not an lvalue
reference, or if it is T&, that T is an object type and is not an
unbounded array
- Add a partial specialization for `__optional_iterator` for `T&`, which
only has the `iterator` type.
- Correct a static assert message as a drive-by
- Move the libcxx specific iterator test into the standard test because
the standard now specifies when the iterator should be available
2025-12-31 13:39:00 +08:00
Matthias Wippich
617b446176
[libc++] Implement P1789R3: Library Support for Expansion Statements (#167184)
[P1789R3](https://isocpp.org/files/papers/P1789R3.pdf) was accepted for
C++26 through LWG motion 14 at the 2025 Kona meeting. This patch
implements it, along with tests and documentation changes.

Closes #167268

---------

Co-authored-by: Tsche <che@pydong.org>
2025-12-26 09:07:13 +08:00
Marcell Leleszi
07a9dae406
[libc++] Implement LWG3476: Remove incorrect decay-copy in std::async and add QoI static_assert improvements (#173363)
Fixes https://github.com/llvm/llvm-project/issues/104307

This patch implements LWG3476 by removing the incorrect decay-copy in
std::async. The decay-copy was being applied twice, once explicitly via
_LIBCPP_AUTO_CAST and once in __async_func's tuple constructor.
(https://github.com/llvm/llvm-project/issues/143828)

It also adds static_assert mandates to std::thread and std::async (which
were already implicitly enforced) and expands test coverage.
2025-12-25 23:01:59 +08:00
William Tran-Viet
4c9d1bdf94
[libc++] Implement P3836R2: Make optional<T&> trivially copyable (#171528)
Resolves #171275

- `*_assign_base` base class trivial overloads needed to be updated to
allow references.
- Add tests
- Update release notes
2025-12-24 15:44:32 +08:00
A. Jiang
f788216b30
[libc++][docs] Mark P2786R13 and P3920R0 "Nothing To Do" (#173348)
As the latter reverted the former.
2025-12-23 23:20:01 +08:00
Aiden Grossman
9e19d0ad47
[libcxx] Mark LWG4275 as complete and remove related TODO (#171665) 2025-12-21 23:56:51 -08:00
Hui
cd13170aea
[libc++] Implement P3567R2 flat_meow fixes (#162022)
Fixes #171272

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-12-20 21:18:44 +00:00
Janet Cobb
ef190061d3
[libc++][concepts] P2404R3: Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with (#99420)
This implements all of [P2404R3](https://wg21.link/p2404r3)'s concept
changes.

---------

Co-authored-by: A. Jiang <de34@live.cn>
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-12-19 17:56:32 +08:00
Mohamed Atef
2c98c6ee0e
[libcxx] LWG4172 fix self-move-assignment in {unique|shared}_lock (#129542)
Fixes: https://github.com/llvm/llvm-project/issues/127861

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-12-19 15:06:39 +08:00
A. Jiang
43cd4a8539
[libc++][docs] Update paper and LWG issue lists after 2025-11 Kona (#172825)
Drive-by: Fix the entry for not-yet-adopted LWG3882.

Resolves #166267
2025-12-18 18:30:58 -05:00
Hristo Hristov
b71348415f
[libc++][ranges] LWG3505: split_view::outer-iterator::operator++ misspecified (#155160)
Implemented in LLVM15:
e53c461bf3

This LWG concerns`lazy_split_view` despite the outdated title.

Closes #104320

# References

- https://wg21.link/LWG3505
- https://wg21.link/range.lazy.split.outer

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-11-14 06:08:17 +02:00
William Tran-Viet
389a23c538
[libc++] Implement P2988R12: std::optional<T&> (#155202)
Resolves #148131

- Unlock `std::optional<T&>` implementation
- Allow instantiations of `optional<T(&)(...)>` and `optional<T(&)[]>`
but disables `value_or()` and `optional::iterator` + all `iterator`
related functions
- Update documentation
- Update tests
2025-11-12 11:00:08 +08:00
A. Jiang
8c52f33a97
[libc++][docs] Update to refer to P3355R2 (#167267)
Per https://github.com/cplusplus/draft/pull/7505, LWG approved P3355R2
and the differences between P3355R1 is subsequently applied. So it seems
better to refer to P3355R2.
2025-11-10 12:17:23 -05:00
A. Jiang
3bb903e3c0
[libc++] Treat P0513R0 as a defect report against C++11 (#166690)
P0513R0 is essentially a collective resolution paper of LWG2543,
LWG2791, LWG2809, and LWG2817.

Among these LWG issues, LWG2543 (conditionally enabled `hash`) and
LWG2817 (`hash<nullptr_t>`) affect pre-C++17 utilities. We generally
backport changes from LWG issues, so this patch backports the relevant
parts of P0513R0.

Although we provide `hash<unique_ptr>` as an extension in C++03 mode, as
C++03 mode isn't encouraged now, this patch leaves `hash<unique_ptr>`
unchanged in C++03 mode.
2025-11-09 08:40:39 +08:00
A. Jiang
bfcd67c347
[libc++][docs] Update status for P2641R4 (#166073)
Follows-up 2527b071ba2e39fdd62eeb73b89318468595c316 which missed
updating the status in the documentations.
2025-11-03 11:59:10 +08:00
A. Jiang
45f97f71af
[libc++][docs] Add missing column headers for GitHub issues (#164745)
We started to list GitHub issues in the status CSV tables/pages due to
e0d0b90d52f54f291c1042046ddf22e925408235. However, the changes made
existing column header insufficient. We probably need to add new column
headers for GitHub issues.
2025-10-23 22:32:21 +08:00
A. Jiang
cecde43009
[libc++][docs] Retarget completion of P2944R3 to LLVM 22 (#163753)
The completion of P2944R3 (4a509f853fa4821ecdb0f6bc3b90ddd48794cc8c)
just missed LLVM 21 release, and it seems controversial that whether
such feature completion should be backported.

I'm aware of following-up cleanup and bugfix about `<tuple>`. Perhaps it
will become more and more unwise to backport the changes. So let's
retarget P2944R3 to LLVM 22 in documentations.

Drive-by: Also fixes the formatting of the entry of P3379R0.
2025-10-19 15:35:47 +08:00
Hristo Hristov
8a27b48122
[libc++][atomic] P2835R7: Expose std::atomic_ref's object address (#162236)
Implements https://wg21.link/P2835R7

Closes #118377

# References

- https://wg21.link/atomics.ref.generic.general
- https://wg21.link/atomics.ref.int
- https://wg21.link/atomics.ref.float
- https://wg21.link/atomics.ref.pointer

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-10-13 20:27:02 +08:00
Hristo Hristov
45c41247f8
[libc++][ranges] P3060R3: Add std::views::indices(n) (#146823)
Implements [P3060R3](https://wg21.link/P3060R3)

Closes #148175

# References

- https://github.com/cplusplus/draft/issues/7966
- https://github.com/cplusplus/draft/pull/8006
- https://wg21.link/customization.point.object
- https://wg21.link/range.iota.overview
- https://wg21.link/ranges.syn

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
Co-authored-by: A. Jiang <de34@live.cn>
2025-10-06 18:13:25 +03:00
Hristo Hristov
ccd06e4809
[libc++][istream] P3223R2: Making std::istream::ignore less surprising (#147007)
Implements https://wg21.link/P3223R2 as a DR as, as recommended in
https://github.com/cplusplus/papers/issues/1871#issuecomment-2993018698.
Resolves -1L ambiguity.

Closes #148178
2025-09-30 11:26:30 -04:00
Hristo Hristov
804b46bb45
[libc++][string] P3044R2: sub-string_view from string (#147095)
Implements [P3044R2](https://wg21.link/P3044R2)

Note: `substr.pass.cpp` is refactored to accommodate the test of
`basic_string_view`'s `subview` which is an alias of `substr` without
changing the test cases.

Closes #148140

# References

- https://github.com/cplusplus/draft/pull/7975
- https://wg21.link/string.substr
- https://wg21.link/string.view.ops

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
2025-09-25 03:08:15 +03:00
William Tran-Viet
fb72f0ca7d
[libc++] Implement Resolution of LWG 3886 (#155356)
Resolves #118336

- Implement the resolution of
[LWG3886](https://cplusplus.github.io/LWG/issue3886) for `optional` and
`expected`
2025-09-24 07:26:40 +08:00
Louis Dionne
e0d0b90d52
[libc++] Start tracking Github issues in status pages (#149833)
This patch adds another row to the Status pages that cross-references
the Github issue. It also ensures that the synchronization script takes
that new row into account.

This should make it easier to find out about the detailed status of a
paper from the status pages by clicking on the link and being taken
directly to its associated Github issue. I expect that this should
remove the need for many "Notes" which simply duplicate the information
of which parts of a paper are implemented: instead we can list that the
implementation is partial and users can click on the Github issue to see
what's implemented.
2025-09-09 16:27:12 -04:00
Nikolas Klauser
34d4f0c136
[libc++][NFC] Use llvm.org/PR to link to bug reports (#156288)
We've built up quite a few links directly to github within the code
base. We should instead use `llvm.org/PR<issue-number>` to link to bugs,
since that is resilient to the bug tracker changing in the future. This
is especially relevant for tests linking to bugs, since they will
probably be there for decades to come. A nice side effect is that these
links are significantly shorter than the GH links, making them much less
of an eyesore.

This patch also replaces a few links that linked to the old bugzilla
instance on llvm.org.
2025-09-04 09:20:02 +02:00
Hristo Hristov
759a2ac5b0
[libc++][ranges] LWG4083: views::as_rvalue should reject non-input ranges (#155156)
Fixes #105351

# References:

- https://wg21.link/LWG4083
- https://wg21.link/range.as.rvalue.overview
2025-09-03 17:17:42 +08:00
William Tran-Viet
1c51886920
[libc++] Implement P3168R2: Give optional range support (#149441)
Resolves #105430

- Implement all required pieces of P3168R2
- Leverage existing `wrap_iter` and `bounded_iter` classes to implement
the `optional` regular and hardened iterator type, respectively
- Update documentation to match
2025-08-18 18:04:45 +03:00
Hristo Hristov
f3008c1140
[libc++][flat_set] LWG3751, LWG3774 (#153934)
- LWG3751: Missing feature macro for `flat_set`

Implemented in LLVM21:
7013b51548

Closes  #105021

- LWG3774: `<flat_set>` should include `<compare>`

Implemented in LLVM21:
2f1416bbcd

684797b644/libcxx/include/flat_set (L77)

Closes #105036
2025-08-17 09:52:07 +08:00
Hristo Hristov
0561ede6c6
[libc++][jthread] LWG3788: jthread::operator=(jthread&&) postconditions are unimplementable under self-assignment (#153758)
Already implemented in LLVM18:
[695138c](695138ca84)

For details see:
https://github.com/llvm/llvm-project/issues/105045#issuecomment-3190674947

Closes #105045
2025-08-16 11:17:30 +08:00
Hristo Hristov
6d40257b05
[libc++][ranges] LWG4096: views::iota(views::iota(0)) should be rejected (#152855)
Fixes #105352
2025-08-13 19:21:13 -04:00
yronglin
24b772769f
[libc++] Implement LWG4222 'expected' constructor from a single value missing a constraint (#152676)
Implement [LWG4222](https://wg21.link/LWG4222).
Closes https://github.com/llvm/llvm-project/issues/148208

Signed-off-by: yronglin <yronglin777@gmail.com>
2025-08-10 01:11:20 +08:00
A. Jiang
4a509f853f
[libc++] Implement comparison operators for tuple added in C++23 (#148799)
And constrain the new `operator==` since C++26.

This patch implements parts of P2165R4, P2944R3, and a possibly improved
resolution of LWG3882. Currently, libstdc++ and MSVC STL constrain the
new overloads in the same way.

Also set feature-test macro `__cpp_lib_constrained_equality` and add
related release note, as P2944R3 will completed with this patch.

Fixes #136765
Fixes #136770
Fixes #105424
2025-08-01 11:53:33 -04:00
Hui
d344c383e2
[libc++][ranges] implement std::ranges::zip_transform_view (#79605)
Fixes #104977
Fixes #105035

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
Co-authored-by: A. Jiang <de34@live.cn>
2025-07-20 09:13:59 +01:00
A. Jiang
3d688233bd
[libc++][docs] Add missing entry for status pages, fix bad formatting, and deduplicate (#148186)
In a previously PR, the entry for P3491R3 define_static_{string,object,array} was missing.
This patch adds it back.

The number of LWG2687, LWG2709, LWG3315, LWG3395, LWG3987, and LWG4113
were duplicated in the title. It seems better to avoid such duplicates.

Also fixes some formatting to properly use italic and code styles, and
remove one improper leading space from the title of P3682R0 (which
caused incorrect alignment in the generated page).
2025-07-15 11:14:41 -04:00
Hristo Hristov
5fc844acd8
[libc++] P2944R3: Constrained comparisons - optional (#144249)
Partially implements [P2944R3](https://wg21.link/P2944R3) which adds
constrained comparisons to std::optional.

Closes #136767


# References
[optional.relops](https://wg21.link/optional.relops)
[optional.comp.with.t](https://wg21.link/optional.comp.with.t)

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-07-15 10:12:39 +02:00
A. Jiang
4177bfdb46
[libc++][docs] Confirm that P2372R3 has been implemented (#148573)
In #125921, the changes requested by P2372R3 were completed and tested
together with corresponding `chrono` types. But that PR didn't mention
P2372R3. The `__cpp_lib_format` FTM was even bumped by an earlier PR
#98275.

This PR confirms that P2372R3 was completed in LLVM 21 (together with P1361R2).
Closes #100043
2025-07-14 10:23:27 -04:00
A. Jiang
e8a50a2568
[libc++][docs] Update paper & LWG issue lists after 2025-06 meeting (#147668)
CWG papers requiring library support are also listed.
2025-07-10 08:56:36 +08:00
Louis Dionne
a34db6f889 [libc++] Mark a few LWG issues as complete instead of Nothing To Do
A few LWG issues did require some testing changes and were not just
non-normative wording changes in the spec, so those should be
"Complete" instead of "Nothing to do".

Also mark LWG3987 and LWG4113 as complete:
- LWG3987 was done in https://github.com/llvm/llvm-project/pull/137524
- LWG4113 was done in https://github.com/llvm/llvm-project/pull/138291
2025-07-09 09:21:27 -04:00
A. Jiang
8ff636309d
[libc++][docs] Fix bad status and links in Cxx2cIssues.csv (#147669)
Currently, versions for (already implemented) LWG4024 and LWG4157 are
listed, but they are not marked "Complete" yet.
- LWG4024 was implemented together with P1020R1 + P1973R1 in 9af9d39a47d.
- LWG4157 was implemented together with P2167R3 in 557f7e1398e1.

Moreover, links for LWG issues resolved in 2025-02 Hagenberg meeting
were broken, they need to be fixed.
2025-07-09 09:20:35 -04:00