Commit Graph

417 Commits

Author SHA1 Message Date
Louis Dionne a64e46880c [libc++][NFC] Update status of old issue LWG2560 -- we implement it properly 2021-09-24 14:22:09 -04:00
Louis Dionne ff0b62dd88 [libc++][NFC] Mark LWG3158 as implemented
It has been implemented in 59e26308e6.
2021-09-24 14:11:52 -04:00
Louis Dionne 1295694364 [libc++][NFC] Add missing link to a ranges review 2021-09-24 11:37:38 -04:00
Kent Ross f4abdb0c07 [libc++][spaceship] Implement std::pair::operator<=>
Implements parts of P1614, including synth-three-way and three way comparison for std::pair.

Reviewed By: #libc, Quuxplusone, Mordante

Differential Revision: https://reviews.llvm.org/D107721
2021-09-22 22:36:46 -07:00
Louis Dionne b034593c87 [libc++][NFC] Add link to Discord channel from documentation 2021-09-22 11:13:53 -04:00
Mark de Wever a04a6ce772 [libc++][format] Adds parser std-format-spec.
This implements the generic std.format.spec framework for all types.

The Unicode support will be added in a separate patch.

Implements parts of:
- P0645 Text Formatting

Completes:
- LWG-3242 std::format: missing rules for arg-id in width and precision
- P1892 Extended locale-specific presentation specifiers for std::format

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103368
2021-09-21 18:29:58 +02:00
Louis Dionne b1fb3d75c9 [libc++] Implement C++20's P0476R2: std::bit_cast
Thanks to Arthur O'Dwyer for fixing up some of the tests.

Differential Revision: https://reviews.llvm.org/D75960
2021-09-09 11:05:54 -04:00
Louis Dionne 312ad74aea [libc++] Implement P1951, default arguments for pair's forwarding constructor
Differential Revision: https://reviews.llvm.org/D109066
2021-09-09 08:28:22 -04:00
Louis Dionne ff7a332e6f [libc++] Revert OpenBSD-related changes to the documentation
This commit partially reverts 0954e2b2d0 and 3fa4cff974, which
make changes to the libc++ documentation implifying that OpenBSD is
supported. Neither of these changes have been reviewed AFAICT, so
I'm reverting as a matter of enforcing:

1. That changes get reviewed before being committed
2. That we have a discussion and a support plan for supporting
   OpenBSD officially in libc++

Please note that I would be thrilled to support OpenBSD officially in
libc++, however doing so requires more than adding a note in the docs.
In particular, please make sure you read the note in [1] about setting
up CI testing for OpenBSD.

[1]: https://libcxx.llvm.org/#platform-and-compiler-support

Differential Revision: https://reviews.llvm.org/D109373
2021-09-08 15:55:03 -04:00
Brad Smith 3fa4cff974 Mention OpenBSD in the documentation 2021-09-07 07:55:17 -04:00
Brad Smith 0954e2b2d0 Mention OpenBSD in the documentation 2021-09-07 04:38:52 -04:00
Mark de Wever fea130cec9 [libc++][doc] Update format status.
Marked the entries solely depending on D103357 or D96664 as complete.
Initial work on implementing P2216 has started.
2021-09-04 13:31:29 +02:00
Mark de Wever df2af9936c [libc++][format] Add a CMake Unicode option.
This option is used to select between the format headers output column
width option. This option should be independent of the locale setting.
It's encouraged to default to Unicode unless the platform doesn't offer
that option.

[format.string.std]/10
```
  For the purposes of width computation, a string is assumed to be in a
  locale-independent, implementation-defined encoding. Implementations
  should use a Unicode encoding on platforms capable of displaying Unicode
```

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103379
2021-09-04 11:55:10 +02:00
Mark de Wever d7444d9f41 [libc++][format] Implement formatters.
This implements the initial version of the `std::formatter` class and its specializations. It also implements the following formatting functions:
- `format`
- `vformat`
- `format_to`
- `vformat_to`
- `format_to_n`
- `formatted_size`

All functions have a `char` and `wchar_t` version. Parsing the format-spec and
using the parsed format-spec hasn't been implemented. The code isn't optimized,
neither for speed, nor for size.

The goal is to have the rudimentary basics working, which can be used as a
basis to improve upon. The formatters used in this commit are simple stubs that
will be replaced by real formatters in later commits.

The formatters that are slated to be replaced in this patch series don't have
an availability macro to avoid merge conflicts.

Note the formatter for `bool` uses `0` and `1` instead of "false" and
"true". This will be fixed when the stub is replaced with a real
formatter.

Implements parts of:
- P0645 Text Formatting

Completes:
- LWG3539 format_to must not copy models of output_iterator<const charT&>

Reviewed By: ldionne, #libc, vitaut

Differential Revision: https://reviews.llvm.org/D96664
2021-09-04 11:41:08 +02:00
Louis Dionne c8439e9a80 [libc++][docs] Remove "Last Updated" entries from the docs
Those don't provide a lot of value, and they can easily be wrong anyway.

Differential Revision: https://reviews.llvm.org/D109087
2021-09-02 13:02:49 -04:00
Mark de Wever 0922ce56f4 [libc++][format] Add __format_arg_store.
This implements the struct `__format_arg_store` and its dependencies:
* the class basic_format_arg,
* the class basic_format_args,
* the class basic_format_context,
* the function make_format_args,
* the function wmake_format_args,
* the function visit_format_arg,
* several Standard required typedefs.

The following parts will be implemented in a later patch:

* the child class `basic_format_arg::handle`,
* the function `basic_format_arg::basic_format_arg(const T* p)`.

The following extension has been implemented:
* the class basic_format_arg supports `__[u]int128_t` on platform where libc++ supports 128 bit integrals.

Implements parts of:
* P0645 Text Formatting

Completes:
* LWG3371 visit_format_arg and make_format_args are not hidden friends
* LWG3542 basic_format_arg mishandles basic_string_view with custom traits

Note https://mordante.github.io/blog/2021/06/05/format.html gives a bit more information about the goals and non-goals of this initial patch series.

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103357
2021-09-01 19:45:02 +02:00
Louis Dionne 9d7ae0acde [libc++][NFC] Correct comment about P0600 missing node_handle bits
Differential Revision: https://reviews.llvm.org/D109027
2021-09-01 10:51:55 -04:00
Joe Loser f76bdb9b82
[libcxx][docs] Mark LWG3356 as complete
Feature test macro for `__cpp_lib_is_nothrow_convertible` was introduced in
466df1718e but the LWG issue was not marked as
`Complete` in the docs. Also, fix the formatting of `Complete` for
LWG 3348.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D108964
2021-09-01 08:20:03 -04:00
Joe Loser 167b2dbde4
[libcxx][docs] Mark LWG3153 as complete
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D108967
2021-08-31 13:54:10 -04:00
Joe Loser 7d7765cef5 [libcxx][docs] Mark LWG3348 as complete
Mark LWG3348 as complete. The `__cpp_lib_unwrap_ref` feature test macro
was placed in `<functional>` in 466df1718e

Differential Revision: https://reviews.llvm.org/D108920
2021-08-30 13:03:57 -04:00
Kent Ross 3fe7dde5f1 [libc++][doc] Cleanup, normalize, and update projects status docs
Mark the now-done [cmp.result] in spaceship projects as complete;
normalize some status markers for papers and projects; fix alignment
and line breaks in spaceship projects, add links to standard

Differential Revision: https://reviews.llvm.org/D108502
2021-08-26 10:33:52 -04:00
Kent Ross 5d993d3bc5 [libc++][doc] Repair files with CRLF line endings.
These are the only files in libc++ that have CRLF line endings instead of LF.

Differential Revision: https://reviews.llvm.org/D108748
2021-08-26 10:09:07 -04:00
Louis Dionne 87dd51983c [libc++] Remove support for CloudABI, which has been abandoned
Based on https://github.com/NuxiNL/cloudlibc, it appears that the CloudABI
project has been abandoned. This patch removes a bunch of CloudABI specific
logic that had been added to support that platform.

Note that some knobs like LIBCXX_ENABLE_STDIN and LIBCXX_ENABLE_STDOUT
coud be useful in their own right, however those are currently broken.
If we want to re-add such knobs in the future, we can do it like we've
done it for localization & friends so that we can officially support
that configuration.

Differential Revision: https://reviews.llvm.org/D108637
2021-08-24 14:11:32 -04:00
Kent Ross 81507bcf6b [libc++] [doc] Add issue tracking for spaceship operator<=> implementation
Add issue tracking and assignment for the implementation of P1614R2: The Mothership has Landed.

Reviewed By: cjdb, #libc, Mordante, Quuxplusone

Differential Revision: https://reviews.llvm.org/D107877
2021-08-19 23:13:44 +00:00
Louis Dionne c67f497e7a [libc++][NFC] Fix indentation of documentation 2021-08-17 10:52:17 -04:00
zoecarver df324bba5c [libcxx][ranges] Add `ranges::join_view`.
Differential Revision: https://reviews.llvm.org/D107671
2021-08-13 11:31:08 -07:00
zoecarver 7b20e05c71 [libcxx][ranges] Add `ranges::iota_view`.
Differential Revision: https://reviews.llvm.org/D107396
2021-08-13 11:31:08 -07:00
Mark de Wever d2bc4fa3c7 [libc++][doc] Improve contributor documentation.
Addresses the post-commit review comments of D107596.
2021-08-11 17:33:54 +02:00
zoecarver f9e58f35e9 [libcxx][ranges] Add `views::counted` CPO.
Differential Revision: https://reviews.llvm.org/D106923
2021-08-10 16:42:28 -07:00
zoecarver 9d982c67ba [libcxx][ranges] Add `ranges::reverse_view`.
Differential Revision: https://reviews.llvm.org/D107096
2021-08-09 15:09:59 -07:00
Louis Dionne d232ec3c2a [libc++] Add timeout to BuildKite jobs
We just had a case where a build bot stalled in an infinite loop during
testing, and the whole pipeline got stuck. To avoid that from happening
in the future, use a timeout on BuildKite jobs.

Differential Revision: https://reviews.llvm.org/D107765
2021-08-09 15:31:04 -04:00
Mark de Wever 6f85d9e104 [libc++][doc] Improve contributor documentation.
Shorty before branching  LLVM 13 a new CMake option was added. This
option `LIBCXX_ENABLE_INCOMPLETE_FEATURES` lacks the contributor
documentation. This patch rectifies that issue.

Differential Revision: https://reviews.llvm.org/D107596
2021-08-09 18:26:07 +02:00
zoecarver 3df649e619 [libcxx][docs] Take locks on the last three views. 2021-07-30 15:08:01 -07:00
zoecarver 481ad59b9f [libcxx][ranges] Add `std::ranges::single_view`.
Differential Revision: https://reviews.llvm.org/D106840
2021-07-30 10:53:20 -07:00
Mark de Wever 92b758cf3d [libcxx][doc] Update the build documentation.
These are the hunks of
  D106770 [libc++][doc] Update the release notes
that are relevant for main.
2021-07-29 07:57:10 +02:00
Arthur O'Dwyer 3894a8a476 [libc++] Implement the resolutions of LWG3506 and LWG3522.
Implement the changes in all language modes.

LWG3506 "Missing allocator-extended constructors for priority_queue"
makes the following changes:
- New allocator-extended constructors for priority_queue.
- New deduction guides targeting those constructors.

LWG3522: "Missing requirement on InputIterator template parameter
for priority_queue constructors". The iterator parameter should be
constrained to actually be an iterator type. `priority_queue{1,2}`
should be SFINAE-friendly ill-formed.

Also, do a drive-by fix in the allocator-extended move constructor:
there's no need to do a `make_heap` after moving from `__q.c` into
our own `c`, because that container was already heapified when it
was part of `__q`. [priqueue.cons.alloc] actually specifies the
behavior and does *not* mention calling `make_heap`. I think this
was just a copy-paste thinko. It dates back to the initial import
of libc++.

Differential Revision: https://reviews.llvm.org/D106824
Differential Revision: https://reviews.llvm.org/D106827
2021-07-28 21:15:20 -04:00
zoecarver 0f4b41e038 [libcxx][ranges] Add ranges::take_view.
Differential Revision: https://reviews.llvm.org/D106507
2021-07-28 12:14:21 -07:00
Tom Stellard 08c766a731 Bump the trunk major version to 14
and clear the release notes.
2021-07-27 21:58:25 -07:00
zoecarver 8a48e6dda9 [libcxx][ranges] Add `counted_iterator`.
Differential Revision: https://reviews.llvm.org/D106205
2021-07-27 15:50:11 -07:00
Mark de Wever 71909de374 [libc++] Disable incomplete library features.
Adds a new CMake option to disable the usage of incomplete headers.
These incomplete headers are not guaranteed to be ABI stable. This
option is intended to be used by vendors so they can avoid their users
from code that's not ready for production usage.

The option is enabled by default.

Differential Revision: https://reviews.llvm.org/D106763
2021-07-27 22:37:35 +02:00
Marek Kurdej 775caa58fc [libc++] [c++2b] [P2166] Prohibit string and string_view construction from nullptr.
* https://wg21.link/P2166

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D106801
2021-07-27 16:20:21 +02:00
Louis Dionne 7b28c5d376 [libc++] Implement the output_iterator and output_range concepts
Differential Revision: https://reviews.llvm.org/D106704
2021-07-26 15:05:17 -04:00
Louis Dionne fbaf7f0bc7 [libc++] Add range_size_t
Differential Revision: https://reviews.llvm.org/D106708
2021-07-26 12:19:26 -04:00
zoecarver e5d8b93e5a [libcxx][ranges] Add `ranges::common_view`.
Differential Revision: https://reviews.llvm.org/D105753
2021-07-23 09:08:49 -07:00
Mark de Wever 678601ecb5 [libc++][doc] Update the LWG issues.
Updates the status pages with the LWG issues accepted in the Standard
during the June 2021 plenary session. The LWG papers for this meeting
have been added in D105103.

Differential Revision: https://reviews.llvm.org/D106529
2021-07-23 10:08:44 +02:00
zoecarver 6f5064cd0c [libc++][docs] Take lock for range.single.view.
Mark this item as in progress and assigned to me.
2021-07-22 11:15:24 -07:00
Christopher Di Bella 74fd3cb8cd [libcxx][ranges] implements dangling, borrowed_iterator_t, borrowed_subrange_t
* Implements part of P0896 'The One Ranges Proposal'
* Implements http://wg21.link/range.dangling

Reviewed By: zoecarver

Differential Revision: https://reviews.llvm.org/D105205
2021-07-21 21:34:13 +00:00
Mark de Wever a08554bcdd [libc++][doc] Fixes a broken link. 2021-07-20 19:49:45 +02:00
zoecarver 1a29403d2f [libcxx][ranges] Add common_iterator.
Differential Revision: https://reviews.llvm.org/D103335
2021-07-20 08:12:44 -07:00
Louis Dionne d153e7d0a5 [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI in <ranges>
We've been forgetting to add those to most of the <ranges> review.
To avoid forgetting in the future, I added an item in the pre-commit
checklist.

Differential Revision: https://reviews.llvm.org/D106287
2021-07-19 19:33:28 -04:00