Commit Graph

8671 Commits

Author SHA1 Message Date
Nikolas Klauser c77de9490e [libc++][NFC] Reformat and modernize compressed_pair.h
Reviewed By: Quuxplusone, ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D119335
2022-02-10 13:41:14 +01:00
Martin Storsjö 3dce6b329c [libcxx] [test] Fix the aligned storage test to work on Windows
Don't test alignment over 8 KB, which isn't supported on that
platform.

Differential Revision: https://reviews.llvm.org/D119348
2022-02-10 10:59:52 +02:00
Konstantin Varlamov 8f1d8785df [libc++][ranges] Implement `permutable`.
Differential Revision: https://reviews.llvm.org/D119222
2022-02-09 20:34:20 -08:00
Casey Carter 009791e0db [libcxx][test] optional's comparisons with optional are not portably constrained
so use them as concept test cases only with libc++.

Differential Revision: https://reviews.llvm.org/D116884
2022-02-09 14:00:24 -08:00
Mark de Wever ece0f70664 [libc++] Enables put_long_double test for glibc.
Glibc adds a +-sign for NaN-values when showpos fmtflags are set.

[tab:ios.fmtflags]
showpos generates a + sign in non-negative generated numeric output

Since NaNs aren't negative this behaviour seems correct. Enable the test
for glibc and add ifdefs to make sure the existing tests still pass.

This was noticed while working on D118971.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D119260
2022-02-09 17:13:13 +01:00
Mark de Wever 11e4001ba2 [libc++][format][nfc] Header cleanup.
Remove the unneeded macro protection, forward declarations, and
includes.

Reviewed By: #libc, Quuxplusone, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D118925
2022-02-09 17:12:04 +01:00
Mark de Wever d9d2ebbfcb [libc++][nfc] Use TEST_HAS_NO_WIDE_CHARACTERS.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D119263
2022-02-09 17:10:12 +01:00
Louis Dionne f13dff68d1 [libc++] Try to fix the quoting of -isystem on Windows bots 2022-02-09 10:08:12 -05:00
Louis Dionne 6f17768e11 [runtimes] Remove support for standalone builds
Standalone build have been deprecated for some time now, so this
commit removes support for those builds entirely from libc++, libc++abi
and libunwind.

This, along with the removal of other legacy ways to build, will allow
for major build system simplifications.

Differential Revision: https://reviews.llvm.org/D119255
2022-02-09 08:55:31 -05:00
Louis Dionne eceb40183c [libc++] Avoid -Wmacro-redefined in libc++ headers in the legacy test config 2022-02-09 08:38:06 -05:00
Nikolas Klauser a5b4479d3c [libc++] Add papers from February 2022 plenary meeting
Reviewed By: ldionne, Quuxplusone, #libc

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D119189
2022-02-09 10:21:19 +01:00
Joe Loser d7095e8035
[libc++] Remove outdated synopsis parts in experimental/functional
Remove mentions of `experimental::function`, its operators, etc. They are no
longer in `experimental/functional`.

Differential Revision: https://reviews.llvm.org/D119204
2022-02-08 19:06:35 -05:00
Casey Carter 0dcb370d43 [libcxx][test] Disable bad unique_ptr<T[]> to shared_ptr<U[]> conversion test cases
for non-libc++. I've reported allowance of these conversions as a bug at https://llvm.org/PR53368.

Differential Revision: https://reviews.llvm.org/D117996
2022-02-08 14:56:47 -08:00
Casey Carter c93a531cae [libcxx][test] tests for strengthened `noexcept` are non-portable
Differential Revision: https://reviews.llvm.org/D117966
2022-02-08 14:54:13 -08:00
Nikolas Klauser e85018b7dd [libc++] Prepare string.{access, capacity, cons} tests for constexpr
Reviewed By: ldionne, #libc

Spies: libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D119123
2022-02-08 23:39:44 +01:00
Louis Dionne 817d897b57 [libc++] Remove _LIBCPP_ABI_UNSTABLE
Previously, _LIBCPP_ABI_UNSTABLE would be used interchangeably with
_LIBCPP_ABI_VERSION >= 2. This was confusing and creating unnecessary
complexity.

This patch removes _LIBCPP_ABI_UNSTABLE -- instead, the LIBCXX_ABI_UNSTABLE
CMake option will result in the LIBCXX_ABI_VERSION being set to '2', the
current unstable ABI. As a result, in the code, we only have _LIBCPP_ABI_VERSION
to check in order to query the current ABI version.

As a fly-by, this also defines the ABI namespace during CMake configuration
to reduce complexity in __config. I believe it was previously done this
way because we used to try to use __config_site as seldom as possible.
Now that we always ship a __config_site, it doesn't really matter and
I think being explicit about how the library is configured in the __config_site
is actually a feature.

Differential Revision: https://reviews.llvm.org/D119173
2022-02-08 15:18:09 -05:00
Louis Dionne 506cf6dc04 [libc++] Fix modules and benchmarks CI builds when incomplete features are disabled
Differential Revision: https://reviews.llvm.org/D119036
2022-02-08 15:15:07 -05:00
Mark de Wever 5dc1da3e30 [libc++][nfc] Use TEST_SAFE_STATIC.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118874
2022-02-08 17:39:21 +01:00
Mark de Wever a0071b9353 [libc++] Removes cpp17_output_iterator's default constructor.
This has been suggested in D117950.

Reviewed By: ldionne, #libc, philnik

Differential Revision: https://reviews.llvm.org/D118971
2022-02-08 17:38:30 +01:00
Mark de Wever e885b1137b [libc++][format[[nfc] Use string_view in tests.
This change is a preparation for adapting the tests for
  P2216 std::format improvements

Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D118717
2022-02-08 17:31:18 +01:00
Louis Dionne 768b50df29 [libc++] Add a Lit configuration for running back-deployment tests
This testing configuration links tests against one libc++ shared library,
but runs them against another libc++ shared library. This makes sure that
we can build applications against the libc++ provided in a recent SDK and
back-deploy them to platforms containing older libc++ dylibs.

It also switches the Apple CI script to using that new configuration
instead of the legacy one.

Differential Revision: https://reviews.llvm.org/D119195
2022-02-08 11:13:58 -05:00
Nikolas Klauser 126663211a [libc++][CI] Put runs into groups
Many CI runs are very similar in nature. Let's put them into groups for a better overview

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson, mstorsjo

Differential Revision: https://reviews.llvm.org/D119059
2022-02-08 01:19:10 +01:00
Joe Loser 66dea85b36
[libc++] Mark some members private in experimental/functional
Some members are public but should be private. Nothing requires they are public
right now, so make them private.

Differential Revision: https://reviews.llvm.org/D119097
2022-02-07 18:06:56 -05:00
Louis Dionne 157bbe6aea [libc++] Remove the ability to use the std::nullptr_t emulation in C++03 mode
Back in https://reviews.llvm.org/D109459, we stopped using the C++03
emulation for std::nullptr_t by default, which was an ABI break. We
still left a knob for users to turn it back on if they were broken by
the change, with a note that we would remove that knob after one release.

The time has now come to remove the knob and clean up the std::nullptr_t
emulation.

Differential Revision: https://reviews.llvm.org/D114786
2022-02-07 17:51:05 -05:00
Ruslan Arutyunyan 6a929492a6 [libcxx][test][NFC] Add tests for backward iteration over associative
containers

Add test cases for iteration over the ordered associative container from
end to begin using operator--

Reviewed By: Quuxplusone, rarutyun

Differential Revision: https://reviews.llvm.org/D118114
2022-02-08 01:21:42 +03:00
Nikolas Klauser 9b0d324154 [libc++][CI] Reorder CI runs
This patch makes the uncontrovertial changes to the pipeline.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D119041
2022-02-07 20:53:13 +01:00
Nikolas Klauser 0e7d7fe912 [libc++] Disable -Wattributes in GCC
Currently GCC produces lots of warnings. Most of them are `-Wattributes`, but these warnings are completly ignored by everybody. So let's disable -Wattributes and make the output cleaner.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D119140
2022-02-07 19:58:25 +01:00
Fangrui Song 0a1c94f915 [libc++][docs] Change some words to use reST inline literals
Reviewed By: #libc, ldionne, Quuxplusone

Differential Revision: https://reviews.llvm.org/D119052
2022-02-07 10:00:42 -08:00
Nikolas Klauser 5488021f3e [libc++] Add Unstable ABI CI run
Reviewed By: ldionne, #libc, Mordante

Spies: mgorny, Mordante, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D118725
2022-02-05 15:37:22 +01:00
Nikolas Klauser 24c12bfb33 [libc++] __config cleanup; _LIBCPP_ABI_UNSTABLE should set _LIBCPP_ABI_VERSION
Some `__config` cleanup and `_LIBCPP_ABI_UNSTABLE` should set `_LIBCPP_ABI_VERSION`, since the latest ABI version //is// the unstable ABI.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D118989
2022-02-05 12:00:54 +01:00
Louis Dionne 78205faf54 [libc++][Docker] Don't actually start using a newer compiler in the CI
To ensure a smooth transition without breaking CI, we should use explicitly
versioned Clangs in the CI jobs definition instead, since that's a change
we can actually test in the CI.

So instead of bumping the compiler version from the Docker image, use
the same version as before by default, and we can bump it from the CI
job definition once all the nodes are running the new image.
2022-02-04 17:17:17 -05:00
Arthur O'Dwyer ea2206d70d [libc++] Replace includes of <utility> with specific detail headers
Basically a rebase of D104980; most of that patch had already happened
via gradual drive-by changes, but this finishes it up.
Don't touch the inclusions from `<__functional_base>`, `<__hash_table>`,
or `<__locale>`; those could be removed if we propagated the
inclusions up to the includers of those files, but there are lots
of those includers.

`<algorithm>`, `<functional>`, and `<memory>` already include `<utility>`
at the top level. `<iterator>` did not, so I've added it there.

Differential Revision: https://reviews.llvm.org/D119020
2022-02-04 17:08:32 -05:00
Louis Dionne a27304c50f [libc++] Bump the version of Clang we use in the CI
Differential Revision: https://reviews.llvm.org/D118830
2022-02-04 17:05:38 -05:00
Arthur O'Dwyer cc1d02ba2d [libc++] No longer support ranges::begin(x) when x is an array of incomplete type.
var-const points out that `ranges::begin` is (non-normatively
but explicitly) always supposed to return a `std::input_or_output_iterator`,
and `Incomplete*` is not a `std::input_or_output_iterator` because it
has no `operator++`. Therefore, we should never return `Incomplete*`
from `ranges::begin(x)`, even when `x` is `Incomplete(&)[]`. Instead,
just SFINAE away.

Differential Revision: https://reviews.llvm.org/D118963
2022-02-04 16:11:39 -05:00
Nikolas Klauser 679f8a885b [libc++] Move fpos into its own header
For some reason `<string>` defines `std::fpos`, which should be defined in `<ios>`.

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D118914
2022-02-04 21:53:43 +01:00
Louis Dionne abcbe87311 [libc++] Remove unused code paths for non-existent builtins
It looks like we added some checks to try and use builtin type traits
in https://reviews.llvm.org/D67900, but some of those type traits are
never implemented as builtins, so this is essentially dead code.

Fixes llvm-project#53569

Differential Revision: https://reviews.llvm.org/D118923
2022-02-04 15:51:42 -05:00
Konstantin Varlamov 254ee89c7a [libc++][ranges][NFC] On the Ranges status page, fix some broken links. 2022-02-04 11:58:35 -08:00
Arthur O'Dwyer 44cdca37c0 [libc++] Define `namespace views` in its own detail header.
Discovered in the comments on D118748: we would like this namespace
to exist anytime Ranges exists, regardless of whether concepts syntax
is supported. Also, we'd like to fully granularize the <ranges> header,
which means not putting any loose declarations at the top level.

Differential Revision: https://reviews.llvm.org/D118809
2022-02-04 12:37:47 -05:00
Arthur O'Dwyer fa6b9e4010 [libc++] Normalize all our '#pragma GCC system_header', and regression-test.
Now we'll notice if a header forgets to include this magic phrase.

Differential Revision: https://reviews.llvm.org/D118800
2022-02-04 12:27:19 -05:00
Nikolas Klauser b82da8b555 [libc++] Remove vector base class
Remove the vector base class as suggested by @ldionne

Reviewed By: ldionne, Quuxplusone, #libc

Spies: libcxx-commits, ldionne

Differential Revision: https://reviews.llvm.org/D117108
2022-02-04 13:06:28 +01:00
Mark de Wever 5e97d37b96 [libc++][NFC] Use cpp17_output_iterator in tests.
The renames the output_iterator to cpp17_output_iterator. These
iterators are still used in C++20 so it's not possible to change the
current type to the new C++20 requirements. This is done in a similar
fashion as the cpp17_input_iterator.

Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D117950
2022-02-04 08:01:20 +01:00
Tiago Macarios eaadc45156 [libc++] Fix chrono::duration constructor constraint
As per [time.duration.cons]/1, the constructor constraint should be on
const Rep2&. As it is now the code will fail to compile in certain
cases, for example (https://godbolt.org/z/c7fPrcTYM):

     struct S{
          operator int() const&& noexcept = delete;
          operator int() const& noexcept;
     };

     const S &fun();

     auto k = std::chrono::microseconds{fun()};

Differential Revision: https://reviews.llvm.org/D118902
2022-02-03 18:07:12 -05:00
Nikolas Klauser 5173f43cc8 [libc++] Remove the std::string base class
Removing the base class of std::basic_string is not an ABI break, so we can remove any references to it from the header.

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D118733
2022-02-03 22:57:23 +01:00
Mark de Wever 959678425d [libc++][nfc] Add TEST_HAS_NO_UNICODE_CHARS.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118832
2022-02-03 08:02:25 +01:00
Konstantin Varlamov 823fa098aa [libc++][ranges][NFC] Test the specializations of `tuple_{size,element}` for ranges.
Also update the synopsis in `<ranges>` to mention the specializations.

Differential Revision: https://reviews.llvm.org/D118686
2022-02-02 22:58:33 -08:00
Nikolas Klauser 610979b301 [libc++][ranges] Add ranges::in_out_out_result
Add `ranges::in_out_out_result`

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D118634
2022-02-03 02:17:48 +01:00
Konstantin Varlamov 7e9d19016e [libc++][ranges][NFC] Small updates to the Ranges status page:
- note that `split_view` has been renamed to `lazy_split_view`.
- fix formatting.
2022-02-02 13:33:15 -08:00
Konstantin Varlamov e65d3760a3 [libc++][ranges] Implement `indirectly_copyable{,_storable}`.
Also refactor tests for `indirectly_movable{,_storable}`.

Differential Revision: https://reviews.llvm.org/D118432
2022-02-02 13:27:44 -08:00
Konstantin Varlamov a37a05d0dc [libc++][ranges][NFC] In the Ranges status, mark move_sentinel as "in progress" 2022-02-02 13:15:54 -08:00
Konstantin Varlamov 298331f14d [libc++][ranges][NFC] Test new requirements for `basic_string_view` and `span` iterators.
Note that most changes to `strings` and `views.span` from the One Ranges
Proposal are no longer applicable:
- free `begin` and `end` functions taking `basic_string_view` and `span`
  were removed by [P1870](http://wg21.link/p1870);
- `span::const_iterator` was removed by [LWG3320](https://cplusplus.github.io/LWG/lwg-defects.html#3320).

Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D118687
2022-02-02 12:54:39 -08:00