1470 Commits

Author SHA1 Message Date
Louis Dionne
5c88aa9d34
[libc++] Document the de-facto status of compiler extension support (#110877)
This was brought up in a maintainer's meeting a few months ago. This
simply documents the current status quo.
2024-10-07 17:27:29 -04:00
A. Jiang
19c6958d24
[libc++] Re-apply LWG3870: Remove voidify (#110944)
This reverts commit f3d58f4161b86a479f68acb453e9622911c688a0.

Relands #110355.
2024-10-03 08:28:26 -04:00
A. Jiang
557f7e1398
[libc++] P2167R3: Improved Proposed Wording for LWG 2114 (#109102)
Only the [cmp.alg] part (for `comparison_meow_fallback` CPOs) in the
paper required changes. Other parts merely fixed preconditions of some
standard library functions.

I strongly feel that P2167R3 should be a DR despite that it is not a DR
officially: CPOs -> C++20; remain parts -> C++98/11 (except that
_`boolean-testable`_ should be transformed into the original
_BooleanTestable_ requirements in the old resolution of LWG2114).

Note that P2167R3 damaged the resolution of LWG3465: the type of `F < E`
was left underconstrained. I've tried to submit an LWG issue for this,
which is now LWG4157.

Drive-by change:
- enable some test coverages in `compare_strong_order_fallback.pass.cpp`
when `TEST_LONG_DOUBLE_IS_DOUBLE`, following up #106742

Closes #105241.
2024-10-03 01:09:53 +08:00
Louis Dionne
8805ff72a0
[libc++] Mark LWG3317 as complete in LLVM 16 (#110757)
This was fixed in 719c3dc6f2f7 and landed in LLVM 16.

Closes #100429
2024-10-02 09:00:41 -04:00
Michael Buch
f3d58f4161
Revert "[libc++] LWG3870: Remove voidify (#110355)" (#110587)
This reverts commit 78f9a8b82d772ff04a12ef95f2c9d31ee8f3e409.

This caused the LLDB test `TestDataFormatterGenericOptional.py` to fail, and we need
a bit more time to look into it.
2024-10-01 08:57:03 -04:00
A. Jiang
78f9a8b82d
[libc++] LWG3870: Remove voidify (#110355)
Instead of changing the cast sequence to implicit conversion in
_`voidify`_, I think it is better to totally remove `__voidify` and use
`static_cast` to `void*`, which has equivalent effects.

Test coverage for const iterators are removed.

Now most affected algorithms are underconstrained, for which I submitted
[LWG3888](https://cplusplus.github.io/LWG/issue3888). I'm not sure
whether we should speculatively implement it at this moment, and thus
haven't added any `*.verify.cpp`.

In some control block types and `optional`, the stored objects are
changed to have cv-unqualified type.

Fixes #105119.
2024-10-01 01:24:00 +08:00
Xiaoyang Liu
51259deb72
[libc++] LWG4025: Move assignment operator of std::expected<cv void, E> should not be conditionally deleted (#109363)
This patch implements LWG4025: Move assignment operator of
`std::expected<cv void, E>` should not be conditionally deleted.

Closes #105324
2024-09-27 12:54:22 -04:00
Xiaoyang Liu
1693c63922
[libc++][NFC] mark LWG3723 as implemented (#109356)
This patch marks LWG3723 as implemented, with the implementation
completed in commit 87f3ff3 and released in `libc++` 17.0.

Closes #105104
2024-09-23 13:45:45 -04:00
Jakub Mazurkiewicz
698be40a51
[libc++] Follow-up to "Poison Pills are Too Toxic" (#88383)
Update the LLVM 19 release notes and the C++23 status
to mention that we implemented this as a DR in C++20.
2024-09-19 10:21:07 -04:00
Hristo Hristov
12b88f835d
[libc++][NFC] Mark P1424R1 as partially implemented (#107751)
`hh_mm_ss` and related functions from https://wg21.link/P1466R3 were
partially implemented in LLVM 10 (fde236b1f719b3a).
2024-09-17 13:04:02 -04:00
Hristo Hristov
6f5dd65630
[libc++][docs] Fix inline code style - use double backticks (#108974)
This is an apparrent omission. Single backick (Markdown style) was used
instead of double backtick for inline code style.
2024-09-17 11:12:44 -04:00
A. Jiang
2d13302d38
[libc++][test] Confirm that P0508R0 has been implemented (#108172)
The paper was implemented by commit b0386a515b60c
(https://reviews.llvm.org/D46845) in LLVM 7.0. But it would be nice to
have test coverage for desired properties of `insert_return_type`.

Closes #99944
2024-09-16 15:34:40 -04:00
Hristo Hristov
397e4dcdc9
[libc++][docs] Add link to VendorDocumentation.rst from TestingLibcxx.rst (#108714)
This makes it easier for readers to locate how to build the library.
2024-09-16 15:34:02 -04:00
Nikolas Klauser
01df775dc4
[libc++] Take the ABI break for std::list's pointer UB unconditionally (#100585)
This ABI break only affects fancy pointer which have a different value
representation when pointing to a base of T instead of T itself. This
seems like a rather small set of fancy pointers, which themselves
already represent a very small niche. This patch swaps a pointer to T
with a pointer to base of T in a few library-internal types.
2024-09-16 11:55:33 -04:00
A. Jiang
94e7c0b051
[libc++] Remove get_temporary_buffer and return_temporary_buffer (#100914)
Works towards P0619R4 / #99985.

The use of `std::get_temporary_buffer` and `std::return_temporary_buffer`
are replaced with `unique_ptr`-based RAII buffer holder.

Escape hatches:
- `_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER` restores
`std::get_temporary_buffer` and `std::return_temporary_buffer`.

Drive-by changes:
- In `<syncstream>`, states that `get_temporary_buffer` is now removed,
because `<syncstream>` is added in C++20.
2024-09-16 11:53:05 -04:00
Nikolas Klauser
27c83382d8
[libc++] Replace __compressed_pair with [[no_unique_address]] (#76756)
This significantly simplifies the code, improves compile times and
improves the object layout of types using `__compressed_pair` in the
unstable ABI. The only downside is that this is extremely ABI sensitive
and pedantically breaks the ABI for empty final types, since the address
of the subobject may change. The ABI of the whole object should not be
affected.

Fixes #91266
Fixes #93069
2024-09-16 11:08:57 +02:00
Hristo Hristov
51f5525689
[libc++][NFC] Mark P1869R1 as implemented (#107746)
https://wg21.link/p1869r1: Rename `condition_variable_any` interruptible
wait methods

The paper was implemented as experimental feature in Clang 18 in:
4fa812bb52

Experimental status removed in:
https://github.com/llvm/llvm-project/pull/107900

Closes https://github.com/llvm/llvm-project/issues/100031

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-09-13 19:05:20 +03:00
Nikolas Klauser
2fb133f32a [libc++][NFC] Reflow release notes
There are a few lines in the release notes which are much wider than the
120 columns we usually use. This reflows the text to keep it below the
threshold.
2024-09-13 11:37:50 +02:00
Louis Dionne
99174842ae
[libc++] Make std::jthread supported in non-experimental mode (#107900)
We waited before supporting std::jthread fully because we wanted to
investigate other implementation strategies (in particular one involving
std::mutex). Since then, we did some benchmarking and decided that we
wouldn't be moving forward with std::mutex. Hence, there is no real
reason to punt on making std::jthread & friends non-experimental.
2024-09-12 09:48:59 -04:00
A. Jiang
3a0ef2a2d3
[libc++] Reland LWG2921 and LWG2976 (#107960)
They were originally implemented in d42db7e083ee0 but reverted later in
a2f3c63282330be0.

This PR implement both LWG issues again, guarding the removed functions
with `_LIBCPP_STD_VER <= 14`, because they should be treated as patches 
for P0302R1 which was adopted for C++17.

Fixes #103598
Fixes #103755
2024-09-11 17:46:59 -04:00
A. Jiang
46a76c3334
[libc++][test] LWG2593: Moved-from state of Allocators (#107344)
The resolution of LWG2593 didn't require the standard library
implementation to change. It merely strengthened requirements on
user-defined allocator types and allowed the implementation to make
stronger assumptions. The status is tentatively set to Nothing To Do.

However, `test_allocator` in libc++'s test suit needs to be fixed to
conform to the strengthened requirements.

Closes #100220.
2024-09-10 09:53:23 -04:00
NoumanAmir-10xe
6776d65cea
[libc++] Implement LWG3953 (#107535)
Closes #105303
2024-09-09 14:49:22 -04:00
Mark de Wever
f4ea19b47e
[libc++][syncbuf] Implement LWG3253 (#99778)
Closes #100264
2024-08-30 10:13:47 -04:00
Louis Dionne
c2cac69d08
[libc++] Replace 'tags' in CSV status pages by inline notes (#105581)
This patch replaces 'tags' in the CSV status pages by inline notes
that optionally describe more details about the paper/LWG issue.

Tags were not really useful anymore because we have a vastly superior
tagging system via Github issues, and keeping the tags up-to-date
between CSV files and Github is going to be really challenging.

This patch also adds support for encoding custom notes in the CSV
files via Github issues. To encode a note in the CSV file, the
body (initial description) of a Github issue can be edited to contain
the following markers:

    BEGIN-RST-NOTES
    text that will be added as a note in the RST
    END-RST-NOTES

Amongst other things, this solves the problem of conveying that a
paper has been implemented as a DR, and it gives a unified way to
add notes to the status pages from Github.
2024-08-28 13:42:41 -04:00
Louis Dionne
cc0f2d540b [libc++] Mark a few papers as done or "Nothing To Do"
Please refer to the Github issues for details on why those are marked
as resolved. Huge thanks to @frederick-vs-ja for the analysis.

Closes #104336
Closes #100042
Closes #100615
2024-08-28 10:05:18 -04:00
A. Jiang
7808541fde
[libc++] P2747R2: constexpr placement new (library part) (#105768)
This patch implements https://wg21.link/P2747R2.

The library changes affect direct `operator new` and `operator new[]`
calls even when the core language changes are absent.

The changes are not available for MS ABI because the `operator new` and
`operator new[]` are from VCRuntime's `<vcruntime_new.h>`. A feature
request was submitted for that [1].

As a drive-by change, the patch reformatted the whole `new.pass.cpp` and
`new_array.pass.cpp` tests.

Closes #105427

[1]: https://developercommunity.visualstudio.com/t/constexpr-for-placement-operator-newope/10730304.
2024-08-28 09:35:57 -04:00
A. Jiang
026210e80d
[libc++][ranges] P2609R3: Relaxing Ranges Just A Smidge (#101715)
This patch implements https://wg21.link/p2609r3.
The test code was originally authored by JMazurkiewicz.

Notes:
- P2609R3 is not officially a Defect Report, but MSVC STL
  implements it in C++20 mode.

  Moreover, P2609R3 and P2997R1 touch exactly the same set of
  concepts, and MSVC STL and libc++ have already treated P2997R1
  as a DR.

- This patch also adjusted feature-test macros.
  + In C++20 mode, the value of __cpp_lib_ranges should be `202110L` because
    - `202202L` covers `range_adaptor_closure` (P2387R3), and
    - `202207L` covers move-only types in range adaptors (P2494R2).
  And all of these changes are only available since C++23 mode.

  + In C++23 mode, the value should be `202406L` because
    - `202211L` covers removing poison overloads (P2602R2),
    - `202302L` covers relaxing projected value types (P2609R3), and
    - `202406L` covers removing requirements on `iter_common_reference_t` (P2997R1).
  And all of these changes are already or being implemented.

Fixes #105253.

Co-authored-by: Jakub Mazurkiewicz <mazkuba3@gmail.com>
2024-08-28 08:55:44 -04:00
A. Jiang
4ea2c73886
[libc++] Deprecate and remove std::uncaught_exception (#101830)
Works towards P0619R4/#99985.

- std::uncaught_exception was not previously deprecated. This patch
  deprecates it since C++17 as per N4259. std::uncaught_exceptions is
  used instead as libc++ unconditionally provides this function.

- _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION restores
  std::uncaught_exception.

- As a drive-by, this patch updates the C++20 status page to 
  explain that D.11 is already done, since it was done in 
  578d09c1b195d859ca7e62840ff6bb83421a77b5.
2024-08-27 17:15:03 -04:00
Louis Dionne
1c48c9cc43
[libc++] Implement P2985R0: std::is_virtual_base_of (#105847)
This trait is implemented in C++26 conditionally on the compiler
supporting the __builtin_is_virtual_base_of intrinsic. I believe only
tip-of-trunk Clang currently implements that builtin.

Closes #105432
2024-08-26 09:58:19 -04:00
Louis Dionne
ff5552c1b8
[libc++] Remove status pages tracking SpecialMath and Zip (#105672)
Instead of tracking those using our static CSV files, I created lists of
subtasks in their respective issues (#99939 and #105169) to track the
work that is still left.
2024-08-23 11:44:45 -04:00
Hristo Hristov
58ac764b01
[libc++] Post-LLVM19-release docs cleanup (#99667)
This patch removes obsolete status pages for projects that were
completed: LLVM 18 release, C++20 Ranges and Spaceship support.

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2024-08-22 10:56:42 -04:00
Louis Dionne
41dcdfbff1 [libc++][docs] Major update to the documentation
- Landing page: add link to the libc++ Discord channel
- Landing page: reorder "Getting Involved" above "Design documents"
- Landing page: remove "Notes and Known Issues" which was completely outdated
- Rename "Using Libc++" to "User Documentation" and update contents
- Rename "Building Libc++" to "Vendor Documentation" and update contents

The "BuildingLibcxx" and "UsingLibcxx" pages have basically been used for
vendor and user documentation respectively. However, they were named in
a way that doesn't really make that clear. Renaming the pages now gives
us a location to clearly document what we target at vendors and what we
target at users, and to do that separately.
2024-08-22 10:30:10 -04:00
Louis Dionne
6d30b67cf0 [libc++] Add link to the Github conformance table from the documentation 2024-08-22 09:01:31 -04:00
Louis Dionne
c73b14ceaa [libc++] Fix the documentation build
There was a duplicate link target.
2024-08-22 08:51:22 -04:00
Louis Dionne
46c94bed5a [libc++] Mark LWG3404 as implemented
LWG3404 was implemented along with subrange.

Closes #104282
2024-08-21 16:54:03 -04:00
Louis Dionne
7a28192ce1 [libc++] Standardize how we track removed and superseded papers
Instead of having various status entries like 'Superseded by XXX',
we use '|Nothing To Do|' but we add a note explaining that the paper
was pulled at another meeting.
2024-08-21 13:45:16 -04:00
Louis Dionne
ec866638ff [libc++][NFC] A few mechanical adjustments to capitalization in status files
Make sure that we consistently use `Nothing To Do`, and that we use the
RST tags properly (e.g. '|Complete|' instead of 'Complete').
2024-08-21 13:29:23 -04:00
Louis Dionne
32c38dd85e
[libc++] Mark C++14 as complete and remove the status pages (#105514)
We already documented that libc++ was C++14 complete, but we still
documented the status of C++14. Since that is redundant (and I suspect
the C++14 status page was missing some stuff), simply remove them.
2024-08-21 10:29:10 -04:00
Mark de Wever
e0441d587b
[libc++][chono] Use hidden friends for leap_second comparison. (#104713)
The function

    template<class Duration>
requires three_way_comparable_with<sys_seconds, sys_time<Duration>>
constexpr auto operator<=>(const leap_second& x, const
sys_time<Duration>& y) noexcept;

Has a recursive constrained. This caused an infinite loop in GCC and is
now hit by https://github.com/llvm/llvm-project/pull/102857.

A fix would be to make this function a hidden friend, this solution is
propsed in LWG4139.

For consistency all comparisons are made hidden friends. Since the issue
causes compilation failures no additional test are needed.

Fixes: https://github.com/llvm/llvm-project/issues/104700
2024-08-20 19:13:27 +02:00
PaulXiCao
29811a81f7
[libc++][docs] Fixing hyperlink for mathematical special function documentation (#104444)
Inter-documentation link for progress tracking of mathematical special
function is fixed.
2024-08-18 15:00:11 +02:00
Nikolas Klauser
85da39debd
[libc++] Remove the allocator<const T> extension (#102655)
In LLVM 19 removed the extension with an opt-in macro. This finally
removes that option too and removes a few `const_cast`s where I know
that they exist only to support this extension.
2024-08-15 20:45:49 +02:00
Louis Dionne
a845dba9e5 [libc++] Remove non-existent LWG issue from the .csv files
We can only track existing LWG issues because we need a valid LWG issue
number for all issues. I'll create another GH issue to track creating
that LWG issue instead.
2024-08-14 16:40:49 -04:00
Louis Dionne
7e5cd8f1b6 [libc++] Mechanical adjustments for the C++14 Paper status files
Make sure Cxx14Papers.csv has the same columns as the other CSV files.
Somehow this was missed in my previous passes to standardize this.
2024-08-14 12:44:43 -04:00
Louis Dionne
9c7020507f [libc++] Remove duplicate C++17 LWG issues from the CSVs
- LWG2308 was voted into C++14 in the 2014 Issaquah meeting
- LWG2682 was voted into C++20 in San Diego 2018, not C++17 in Issaquah
- LWG2769 was voted into C++17 in Kona 2017, not Issaquah 2016
2024-08-14 12:28:32 -04:00
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