[libc++] add zip_view and views::zip for C++23- add zip_view and views::zip for C++23- added unit tests- implemented section 5.6 (zip) in P2321R2I used clang-format to format the files but they
[libc++] add zip_view and views::zip for C++23- add zip_view and views::zip for C++23- added unit tests- implemented section 5.6 (zip) in P2321R2I used clang-format to format the files but they look nothing like the rest of the code base. Manually indenting each line to match the styles sounds like an impossible task. Is there any clang-format file which can format it reasonable similar to the rest of the code base so that I can manually format the rest lines that look weird?Reviewed By: ldionne, #libc, philnik, var-constSpies: Mordante, philnik, libcxx-commits, mgornyDifferential Revision: https://reviews.llvm.org/D122806
show more ...
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.All supported compilers that support C++20 now support concepts. So, remove`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBC
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.All supported compilers that support C++20 now support concepts. So, remove`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBCPP_STD_VER > 17`. Similarly inthe tests, remove `// UNSUPPORTED: libcpp-no-concepts`.Differential Revision: https://reviews.llvm.org/D121528
[libc++] Granularize <utility> includesReviewed By: ldionne, #libcSpies: EricWF, libcxx-commits, arphamanDifferential Revision: https://reviews.llvm.org/D120466
[libc++] Removes base member from tests.Change the tests to use the base friend function instead of members.Also changed some types to have a base friends instead of members.Reviewed By: #libc,
[libc++] Removes base member from tests.Change the tests to use the base friend function instead of members.Also changed some types to have a base friends instead of members.Reviewed By: #libc, ldionne, QuuxplusoneDifferential Revision: https://reviews.llvm.org/D120742
[libcxx][test] tests for strengthened `noexcept` are non-portableDifferential Revision: https://reviews.llvm.org/D117966
[libc++] Fix LWG3533 "Make `base() const&` consistent..."Fixed in counted_iterator and transform_view::iterator.The LWG issue also affected elements_view::iterator, but we haven'timplemented that
[libc++] Fix LWG3533 "Make `base() const&` consistent..."Fixed in counted_iterator and transform_view::iterator.The LWG issue also affected elements_view::iterator, but we haven'timplemented that one yet, and whoever does implement it will getthe fix for free if they just follow the working draft's wording.Drive-by stop calling `.base()` on test iterators in the test,and improve the transform_view::iterator/sentinel tests.Differential Revision: https://reviews.llvm.org/D117329
[libcxx][test] the domain of == for forward iterators is iterator values from the same range* Default-initialized `basic_string` iterators are not portably in the domain of `==`.* Avoid comparing
[libcxx][test] the domain of == for forward iterators is iterator values from the same range* Default-initialized `basic_string` iterators are not portably in the domain of `==`.* Avoid comparing iterators from non-equal string_views which MSVCSTL considers not to be in the domain of equality.* Don't test invalid range `[in, out + N)`.Also silence some truncation warnings by testing with a non-narrowing conversion.Differential Revision: https://reviews.llvm.org/D118049
[libc++] [ranges] Implement P2415R2 owning_view."What is a view?"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2415r2.htmlhttps://github.com/cplusplus/draft/pull/5010/filesThis was a
[libc++] [ranges] Implement P2415R2 owning_view."What is a view?"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2415r2.htmlhttps://github.com/cplusplus/draft/pull/5010/filesThis was a late-breaking (Oct 2021) change to C++20.The only thing missing from this patch is that we're supposedto bump the feature-test macro from #define __cpp_lib_ranges 202106Lto #define __cpp_lib_ranges 202110Lbut we can't do that because we don't implement all of 202106 Ranges yet.Differential Revision: https://reviews.llvm.org/D116894
[libc++][NFC] Fix incorrect synopsis in transform_view test
[libc++] [test] Simplify some ranges tests.Eliminate a bogus operator== overload.Also, check more intermediate steps in the logic we're checking here.Some of this simplification is possible only
[libc++] [test] Simplify some ranges tests.Eliminate a bogus operator== overload.Also, check more intermediate steps in the logic we're checking here.Some of this simplification is possible only now that we've implementedmore of <ranges>.Differential Revision: https://reviews.llvm.org/D116002
[libc++] Work around a Clang bug in transform_view, and regression-test.Clang trunk rejects the new test case, but this is a Clang bug(PR47414, 47509, 50864, 44833).```In module 'std' imported
[libc++] Work around a Clang bug in transform_view, and regression-test.Clang trunk rejects the new test case, but this is a Clang bug(PR47414, 47509, 50864, 44833).```In module 'std' imported from /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:17:/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:85:44: error: constraints not satisfied for alias template 'range_reference_t' [with _Rp = const NonConstView] regular_invocable<const _Fn&, range_reference_t<const _View>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:416:25: note: in instantiation of template class 'std::ranges::transform_view<NonConstView, (lambda at /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:73:71)>' requested here -> decltype( transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f))) ^```We can work around this by adding a layer of indirection: put theproblematic constraint into a named concept and Clang becomes moreamenable to SFINAE'ing instead of hard-erroring.Drive-by simplify `range.transform/general.pass.cpp` to make it clearerwhat it's actually testing in this area.Differential Revision: https://reviews.llvm.org/D115116
[libc++] [test] s/ContiguousView/MoveOnlyView/g. NFCI.The unique (ha!) thing about this range type is that it's move-only.Its contiguity is unsurprising (most of our test ranges are contiguous).D
[libc++] [test] s/ContiguousView/MoveOnlyView/g. NFCI.The unique (ha!) thing about this range type is that it's move-only.Its contiguity is unsurprising (most of our test ranges are contiguous).Discussed in D111231 but committed separately for clarity.
[libc++] [test] Change a lot of free begin/end pairs to members. NFCI.If you have a `begin() const` member, you don't need a `begin()` memberunless you want it to do something different (e.g. have
[libc++] [test] Change a lot of free begin/end pairs to members. NFCI.If you have a `begin() const` member, you don't need a `begin()` memberunless you want it to do something different (e.g. have a different returntype). So in general, //view// types don't need `begin()` non-const members.Also, static_assert some things about the types in "types.h", so that wedon't accidentally break those properties under refactoring.Differential Revision: https://reviews.llvm.org/D111231
[libc++] [ranges] Uncomment operator<=> in transform and iota iterators.The existing tests for transform_view::iterator weren't quite right,and can be simplified now that we have more of C++20 ava
[libc++] [ranges] Uncomment operator<=> in transform and iota iterators.The existing tests for transform_view::iterator weren't quite right,and can be simplified now that we have more of C++20 available to us.Having done that, let's use the same pattern for iota_view::iteratoras well.Differential Revision: https://reviews.llvm.org/D110774
[libc++] Move libc++ specific tests to `libcxx/test/libcxx`This is consistent with what we've been doing forever.
[libc++] Clarify the name of Lit features related to standard library selectionBefore this patch, we had features named 'libc++', 'libstdc++' and'msvc' to describe the three implementations that u
[libc++] Clarify the name of Lit features related to standard library selectionBefore this patch, we had features named 'libc++', 'libstdc++' and'msvc' to describe the three implementations that use our test suite.This patch renames them to 'stdlib=libc++', 'stdlib=libstdc++', etcto avoid confusion between MSVC's STL and the MSVC compiler (or Clangin MSVC mode).Furthermore, this prepares the terrain for adding support for additional"implementations" to the test suite. Basically, I'd like to be able totreat Apple's libc++ differently from LLVM's libc++ for the purpose oftesting, because those effectively behave in different ways in some aspects.
[libc++] Various cleanups in the ranges tests- Rename test files to follow conventions better- Split constructor tests that were in a single file- Add missing tests for take_view and transform_vi
[libc++] Various cleanups in the ranges tests- Rename test files to follow conventions better- Split constructor tests that were in a single file- Add missing tests for take_view and transform_view's default constructors- Add missing tests for transform_view's view/function constructor- Fix include guards- Mark some tests as being specific to libc++Differential Revision: https://reviews.llvm.org/D108829
[libc++] Implement the underlying mechanism for range adaptorsThis patch implements the underlying mechanism for range adaptors. Itdoes so based on http://wg21.link/p2387, even though that paper h
[libc++] Implement the underlying mechanism for range adaptorsThis patch implements the underlying mechanism for range adaptors. Itdoes so based on http://wg21.link/p2387, even though that paper hasn'tbeen adopted yet. In the future, if p2387 is adopted, it would sufficeto rename `__bind_back` to `std::bind_back` and `__range_adaptor_closure`to `std::range_adaptor_closure` to implement that paper by the spec.Differential Revision: https://reviews.llvm.org/D107098
[libc++][NFC] Refactor tests for transform_viewAdjust the names of helper function objects to represent better whatthey do, as suggested in the review of D107098.
[libc++] Remove Lit annotations for unsupported GCC versions from the test suiteSince we officially don't support several older compilers now, we candrop a lot of the markup in the test suite. Thi
[libc++] Remove Lit annotations for unsupported GCC versions from the test suiteSince we officially don't support several older compilers now, we candrop a lot of the markup in the test suite. This helps keep the testsuite simple and makes sure that UNSUPPORTED annotations don't rot.This is the first patch of a series that will remove annotations forcompilers that are now unsupported.Differential Revision: https://reviews.llvm.org/D107787
[libc++][NFC] Fix copy-paste error in the transform_view tests
[libcxx][ranges] Add ranges::take_view.Differential Revision: https://reviews.llvm.org/D106507
[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. Thisoption is intende
[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. Thisoption is intended to be used by vendors so they can avoid their usersfrom code that's not ready for production usage.The option is enabled by default.Differential Revision: https://reviews.llvm.org/D106763
[libcxx][nfc] Global `constexpr friend` -> `friend constexpr`.
[libcxx][ranges] Add `ranges::transform_view`.Reviewed By: cjdb, ldionne, #libcDifferential Revision: https://reviews.llvm.org/D103056