Commit Graph

8628 Commits

Author SHA1 Message Date
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
Konstantin Varlamov f681d7d558 [libc++][ranges][NFC] Add contiguous_iterator_tag to the <iterator> synopsis
It was previously implemented by commit [45d048c20](https://reviews.llvm.org/rG45d048c20440989df2b4e1be1f9343225e7741ab).

Reviewed By: #libc, Quuxplusone, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118751
2022-02-02 12:53:15 -08:00
Haowei Wu 1a3137dc84 [libc++] Add UNSUPPORTED for clang-15
This started breaking in the CI because we bumped the Clang version
to 15, which requires adjusting the markup in the test suite.

Differential Revision: https://reviews.llvm.org/D118838
2022-02-02 12:33:04 -08:00
Arthur O'Dwyer 0b5fb7c604 [libc++] [NFC] s/__referenceable/__can_reference/
The Standard name for this exposition-only concept is _can-reference_.

Differential Revision: https://reviews.llvm.org/D118726
2022-02-02 13:40:21 -05:00
Louis Dionne c06b4bc89c [libc++] UNSUPPORT GDB pretty printers with Clang 15 (which is what main is) 2022-02-02 12:44:00 -05:00
Arthur O'Dwyer ab9a571a94 [libc++] [test] Fix a couple of copy-paste comments. NFC. 2022-02-02 12:08:33 -05:00
Arthur O'Dwyer b2a0cc1c65 [libc++] Guard bits of 598983d7 against _LIBCPP_HAS_NO_CONCEPTS. 2022-02-02 11:19:46 -05:00
Arthur O'Dwyer 93e7f35ac3 [libc++] [NFC] Normalize some `#ifndef _LIBCPP_HAS_NO_CONCEPTS`. 2022-02-02 11:02:56 -05:00
Arthur O'Dwyer 38db42d004 [libc++] [NFC] s/_LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)/!defined(_LIBCPP_HAS_NO_CONCEPTS)/
Per Discord discussion, we're normalizing on a simple `!defined(_LIBCPP_HAS_NO_CONCEPTS)`
so that we can do a big search-and-replace for `!defined(_LIBCPP_HAS_NO_CONCEPTS)`
back into `_LIBCPP_STD_VER > 17` when we're ready to abandon support for concept-syntax-less
compilers.

Differential Revision: https://reviews.llvm.org/D118748
2022-02-02 11:02:56 -05:00
Louis Dionne 99ae458231 [libc++] Add CI without experimental features and don't exclude span from the tests
There is no reason for the parts of std::span that don't depend on ranges
to be disabled when ranges aren't provided. Also, to make sure the
"no-experimental-stuff" configuration is tested, add a CI job for it.

Differential Revision: https://reviews.llvm.org/D118740
2022-02-02 10:48:35 -05:00
Nikolas Klauser 598983d7a9 [libc++][P2321R2] Add specializations of basic_common_reference and common_type for pair
Add specializations of basic_common_reference and common_type for pair

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D117506
2022-02-02 10:47:04 +01:00
Tom Stellard a2601c9887 Bump the trunk major version to 15 2022-02-01 23:54:52 -08:00
Konstantin Varlamov e1f7edb64b [libc++][ranges][NFC] Fix an inconsistent patch link on the Ranges status page. 2022-02-01 16:50:33 -08:00
Konstantin Varlamov 039e55d618 [libc++][ranges][NFC] In the Ranges status, list the changes to stream.iterators 2022-02-01 14:41:09 -08:00
Konstantin Varlamov d5ce90f414 [libc++][ranges][NFC] In the Ranges status, list the changes to predef.iterators 2022-02-01 14:34:40 -08:00
Nikolas Klauser 453620f55e [libc++] Make _VSTD and alias for std
There is no practical difference between `_VSTD` and `std` so we should just remove `_VSTD`. This is the first step.

Reviewed By: ldionne, #libc

Spies: jeroen.dobbelaere, wmaxey, EricWF, lebedev.ri, __simt__, dim, mgrang, sstefan1, wenlei, smeenai, libcxx-commits, #libc_vendors

Differential Revision: https://reviews.llvm.org/D117811
2022-02-01 22:41:51 +01:00
Mark de Wever d7c4072fdb [libc++] Remove unneeded qualifier.
In D117811 @Quuxplusone pointed out the friend declarations don't need
to be qualified. Removing the qualification should avoid needing to add
a GCC work-around when changing _VSTD to std.

Reviewed By: Quuxplusone, philnik, #libc, ldionne

Differential Revision: https://reviews.llvm.org/D118719
2022-02-01 16:33:03 -05:00
Louis Dionne 4f67a90990 [libc++] Fix TOCTOU issue with std::filesystem::remove_all
https://bugs.chromium.org/p/llvm/issues/detail?id=19
rdar://87912416

Differential Revision: https://reviews.llvm.org/D118134
2022-02-01 15:31:28 -05:00
Louis Dionne c7b255e5a8 [libc++][ci] Re-enable the bootstrapping build
Differential Revision: https://reviews.llvm.org/D118067
2022-02-01 15:29:00 -05:00
Arthur O'Dwyer 6a56d5cc25 [libc++] Fix LWG3589 "The const lvalue reference overload of get for subrange..."
https://cplusplus.github.io/LWG/issue3589

Differential Revision: https://reviews.llvm.org/D117961
2022-02-01 15:14:44 -05:00
Nikolas Klauser 9c52a19e32 [libc++][NFC] Add namespace comments in ranges
With this patch there should be no more namespaces without closing comment

Reviewed By: ldionne, Quuxplusone, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D118668
2022-02-01 18:18:13 +01:00
Konstantin Varlamov 85dae4c11e [libc++][ranges][NFC] Fix formatting on newly-added links on the Ranges status page. 2022-01-31 14:45:21 -08:00
Martin Storsjö eb9645819c [libcxx] [Windows] Pick a unique bit for __regex_word
The old `__regex_word` aliased the mask for `xdigit`, causing stray
test failures.

The diff may look surprising, as if the previous faulty value had
been set specifically for Windows - but this is due to a restructuring
in 411c630bae. Prior to that, there
were OS specific settings for some OSes, and one fallback used for
the rest (which turns out to not work for Windows).

Differential Revision: https://reviews.llvm.org/D118188
2022-01-31 23:13:58 +02:00
Martin Storsjö 1a5388ca67 [libcxx] [Windows] Use the standard vsnprintf instead of _vsnprintf
In ancient Microsoft C runtimes, there might only have been
a nonstandard `_vsnprintf` instead of the standard `vsnprintf`, but
in modern versions (the only ones relevant for libc++), both
are available.

In MinGW configurations built with `__USE_MINGW_ANSI_STDIO=1` (as it
is built in CI), `vsnprintf` provides a more standards compliant
behaviour than what Microsoft's CRT provides, while `_vsnprintf` retains
the Microsoft C runtime specific quirks.

Differential Revision: https://reviews.llvm.org/D118187
2022-01-31 22:29:12 +02:00
Louis Dionne 2e7532c003 [libc++][NFC] Mark a few issues and papers as implemented
Differential Revision: https://reviews.llvm.org/D118638
2022-01-31 14:53:07 -05:00
Konstantin Varlamov 7c89c2ac6f [libc++][ranges][NFC] Add some missing links to the Ranges status page. 2022-01-31 11:23:40 -08:00
Arthur O'Dwyer bf150e8dab [libc++] [ranges] ADL-proof ranges::iter_{swap,move}.
As discovered in D117817, `std::ranges::input_range<Holder<Incomplete>*[10]>`
hard-errored before this patch. That's because `input_range` requires
`iter_rvalue_reference_t`, which requires `iter_move`, which was
not ADL-proofed.

Add ADL-proofing tests to all the range refinements.
`output_range` and `common_range` shouldn't be affected,
and all the others subsume `input_range` anyway, but we might as
well be thorough.

Differential Revision: https://reviews.llvm.org/D118213
2022-01-31 14:14:26 -05:00
Arthur O'Dwyer c965d5448e [libc++] [ranges] Implement std::ranges::distance
This includes an experimental workaround for
LWG3664 "LWG3392 broke std::ranges::distance(a, a+3)",
but the workaround may be incomplete, I'm not sure.
This should be re-audited when LWG3664 is actually adopted,
to see if we need to change anything about our implementation.

See also https://github.com/microsoft/STL/pull/2500

Differential Revision: https://reviews.llvm.org/D117940
2022-01-31 12:23:10 -05:00
Arthur O'Dwyer 23f73ff5f6 [libc++] [NFC] Audit LWG issues for "Nothing To Do" and "Complete".
Each "Nothing To Do" issue only changed nits in the English wording,
not anything to do with the code.
Each "Complete" issue was completed already, as far as I can tell.
I tried to err on the side of caution: I didn't mark a few issues
whose P/Rs were very invasive and would take time to verify, and I
didn't mark a lot of issues involving features we haven't even started
yet.

Differential Revision: https://reviews.llvm.org/D117960
2022-01-31 12:10:22 -05:00
Arthur O'Dwyer 2eb2ff2a02 [libc++] Merge _LIBCPP_HAS_NO_RANGES into _LIBCPP_HAS_NO_CONCEPTS. NFC.
The macro that opts out of `std::ranges::` functionality is called
`_LIBCPP_HAS_NO_INCOMPLETE_RANGES`, and is unrelated to this macro
which is specifically about _compiler_ support for the _syntax_.

The only non-mechanical diff here is in `<__config>`.

Differential Revision: https://reviews.llvm.org/D118507
2022-01-31 12:10:22 -05:00
Nikolas Klauser 5d2b8fa155 [libc++][test] add vector<bool>::reference tests
Add test coverage for `vector<bool>::reference`

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D117780
2022-01-31 17:46:12 +01:00
Nikolas Klauser f3514af492 [libc++][ranges] Add ranges::in_in_out_result
Add `ranges::in_in_out_result`

Reviewed By: Quuxplusone, Mordante, #libc

Spies: CaseyCarter, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D117512
2022-01-31 16:33:45 +01:00
Mark de Wever ab0554b2ec [libc++][format][nfc] Move tests.
The formatter specialization tests were placed in the wrong
subdirectory. This moves them to the proper place.
2022-01-30 14:21:13 +01:00
Mark de Wever 7927b69a6b [libc++][doc] Update the release notes.
I had a look at the changes since the last release and updated the
release notes with interesting changes.

It seems this time the release notes were already rather up to date :-)

If there are more interesting changes, please let me know and I'll
update the patch. I'd like to commit these changes latest next weekend
so they land before branching the 14.0 release.

I've added most active libc++ contributors. If I forgot anybody please add them.

Reviewed By: Quuxplusone, ldionne, philnik, #libc

Differential Revision: https://reviews.llvm.org/D117948
2022-01-30 14:16:56 +01:00
Joe Loser 81cc834a48
[libc++][test] Clean up libcxx/test/support/MoveOnly.h
Remove copy and copy assignment rather than have them as private declarations.
They are superfluous given the move and move assignment.

As a drive-by, also specialize `std::hash` without reopening `namespace std`.

Differential Revision: https://reviews.llvm.org/D118502
2022-01-29 18:20:46 -05:00
Arthur O'Dwyer d1c4c75531 [libc++] Fix the last instances of `namespace ranges::inline...`. NFC.
Make these look the same as everywhere else.
2022-01-29 11:10:04 -05:00
Arthur O'Dwyer da23e87319 [libc++] [test] Mark two ranges tests with libcpp-has-no-incomplete-ranges.
Should fix the Apple build CI, e.g.
https://buildkite.com/llvm-project/libcxx-ci/builds/8227
2022-01-29 10:14:02 -05:00
Konstantin Varlamov 46283589ef [libc++][ranges][NFC] Small cleanup to the Ranges status page.
- add a few missing links to code reviews;
- reorder the views to follow the same order as in the Standard.
2022-01-28 22:40:07 -08:00
John Ericson 7017e6c9cf [cmake] Partially deduplicate `{llvm,compiler_rt}_check_linker_flag` for runtime libs and llvm
We previously had a few varied definitions of this floating around.

I had tried to make the one installed with LLVM handle all the cases, and then made the others use it, but this ran into issues with `HandleOutOfTreeLLVM` not working for compiler-rt, and also `CMAKE_EXE_LINKER_FLAGS` not working right without `CMP0056` set to the new behavior.

 My compromise solution is this:

 - No not completely deduplicate: the runtime libs will instead use a version that still exists as part of the internal and not installed common shared CMake utilities. This avoids `HandleOutOfTreeLLVM` or a workaround for compiler-rt.

- Continue to use `CMAKE_REQUIRED_FLAGS`, which effects compilation and linking. Maybe this is unnecessary, but it's safer to leave that as a future change. Also means we can avoid `CMP0056` for now, to try out later, which is good incrementality too.

- Call it `llvm_check_compiler_linker_flag` since it, in fact is about both per its implementation (before and after this patch), so there is no name collision.

In the future, we might still enable CMP0056 and make compiler-rt work with HandleOutOfTreeLLVM, which case we delete `llvm_check_compiler_flag` and go back to the old way (as these are, in fact, linking related flags), but that I leave for someone else as future work.

The original issue was reported to me in https://reviews.llvm.org/D116521#3248117 as
D116521 made clang and LLVM use the common cmake utils.

Reviewed By: sebastian-ne, phosek, #libunwind, #libc, #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D117537
2022-01-29 06:07:24 +00:00
Konstantin Varlamov c38c134b62 [libc++][ranges][NFC] Update and slightly cleanup Ranges status page.
- add missing links to sections of the Standard and to patches;
- update the status on a couple of items.
2022-01-28 20:15:36 -08:00
Martin Storsjö 9a9a372d38 [libcxx] [test] Fix testcases that fail on systems with 16 bit wchar_t
Don't decode a UTF-8 character that is out of range for a 16 bit
`wchar_t`.

Differential Revision: https://reviews.llvm.org/D118191
2022-01-28 11:21:14 +02:00
Martin Storsjö de5d38ef2d [libcxx] Allow using thread safety annotations in MinGW mode
These were omitted in all Windows configurations, but it turns out
that they work just fine in MinGW mode.

This allows converting a couple cases of "XFAIL: LIBCXX-WINDOWS-FIXME"
into "XFAIL: msvc" as the bug is specific to MSVC mode (clang-cl).

Differential Revision: https://reviews.llvm.org/D118192
2022-01-28 11:20:58 +02:00
Arthur O'Dwyer bf20a09790 [libc++] [P1614] Implement the second half of [cmp.alg]: compare_{strong,weak,partial}_fallback.
The tests for these are just copy-pasted from the tests for std::{strong,weak,partial}_order,
and then I added an extra clause in each (test_2()) to test the stuff that's not just the same
as std::*_order.

This also includes the fix for https://wg21.link/LWG3465 (which falls naturally out of the
"you must write it three times" style, but I've added test cases for it also).

There is an action item here to go back and give good diagnostics for SFINAE failures
in these CPOs. I've filed this as https://github.com/llvm/llvm-project/issues/53456 .

Differential Revision: https://reviews.llvm.org/D111514
2022-01-27 17:48:01 -05:00
Brian Cain d5ab243c6f Omit atomic_{,un}signed_lock_free if unsupported
On targets that have limited atomic support, e.g. ones that define
ATOMIC_*_LOCK_FREE to '1' ("sometimes lock free"), we would end up
referencing yet-undefined __libcpp_{,un}signed_lock_free.

This commit adds a guard to prevent these references for such
targets.

Differential Revision: https://reviews.llvm.org/D118391
2022-01-27 14:29:08 -08:00