[libc++] Guard much of std::ranges under _LIBCPP_HAS_NO_INCOMPLETE_RANGES.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 1 Feb 2022 21:52:02 +0000 (16:52 -0500)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 15 Feb 2022 15:38:21 +0000 (10:38 -0500)
commit53406fb691db38b21decf233e091f648f8317b2d
tree0fac0bb904432de6d279aad6e3fd1ad90b08b03e
parent149ad3d554c6e901a57c7e34e29fba334dcd283c
[libc++] Guard much of std::ranges under _LIBCPP_HAS_NO_INCOMPLETE_RANGES.

The logic here is that we are disabling *only* things in `std::ranges::`.
Everything in `std::` is permitted, including `default_sentinel`, `contiguous_iterator`,
`common_iterator`, `projected`, `swappable`, and so on. Then, we include
anything from `std::ranges::` that is required in order to make those things
work: `ranges::swap`, `ranges::swap_ranges`, `input_range`, `ranges::begin`,
`ranges::iter_move`, and so on. But then that's all. Everything else (including
notably all of the "views" and the `std::views` namespace itself) is still
locked up behind `_LIBCPP_HAS_NO_INCOMPLETE_RANGES`.

Differential Revision: https://reviews.llvm.org/D118736
88 files changed:
libcxx/include/__algorithm/in_in_out_result.h
libcxx/include/__algorithm/in_out_result.h
libcxx/include/__algorithm/ranges_min_element.h
libcxx/include/__filesystem/directory_iterator.h
libcxx/include/__filesystem/recursive_directory_iterator.h
libcxx/include/__functional/ranges_operations.h
libcxx/include/__iterator/advance.h
libcxx/include/__iterator/distance.h
libcxx/include/__iterator/insert_iterator.h
libcxx/include/__iterator/iter_move.h
libcxx/include/__iterator/iter_swap.h
libcxx/include/__iterator/next.h
libcxx/include/__iterator/prev.h
libcxx/include/__memory/concepts.h
libcxx/include/__memory/ranges_construct_at.h
libcxx/include/__memory/ranges_uninitialized_algorithms.h
libcxx/include/__ranges/all.h
libcxx/include/__ranges/common_view.h
libcxx/include/__ranges/concepts.h
libcxx/include/__ranges/copyable_box.h
libcxx/include/__ranges/counted.h
libcxx/include/__ranges/dangling.h
libcxx/include/__ranges/data.h
libcxx/include/__ranges/drop_view.h
libcxx/include/__ranges/empty.h
libcxx/include/__ranges/empty_view.h
libcxx/include/__ranges/enable_borrowed_range.h
libcxx/include/__ranges/enable_view.h
libcxx/include/__ranges/iota_view.h
libcxx/include/__ranges/join_view.h
libcxx/include/__ranges/non_propagating_cache.h
libcxx/include/__ranges/owning_view.h
libcxx/include/__ranges/range_adaptor.h
libcxx/include/__ranges/rbegin.h
libcxx/include/__ranges/ref_view.h
libcxx/include/__ranges/rend.h
libcxx/include/__ranges/reverse_view.h
libcxx/include/__ranges/single_view.h
libcxx/include/__ranges/size.h
libcxx/include/__ranges/subrange.h
libcxx/include/__ranges/take_view.h
libcxx/include/__ranges/transform_view.h
libcxx/include/__ranges/view_interface.h
libcxx/include/ranges
libcxx/include/span
libcxx/include/string_view
libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_input_iterator.compile.pass.cpp
libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp
libcxx/test/libcxx/ranges/range.utility.helpers/has_arrow.compile.pass.cpp
libcxx/test/std/algorithms/algorithms.results/in_in_result.pass.cpp
libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/constraints.verify.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/lwg3664.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.compile.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.compile.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count.pass.cpp
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count_sentinel.pass.cpp
libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
libcxx/test/std/iterators/predef.iterators/counted.iterator/compare.pass.cpp
libcxx/test/std/iterators/predef.iterators/iterators.common/assign.pass.cpp
libcxx/test/std/ranges/range.access/begin.pass.cpp
libcxx/test/std/ranges/range.access/end.pass.cpp
libcxx/test/std/ranges/range.req/range.range/borrowed_range.compile.pass.cpp
libcxx/test/std/ranges/range.req/range.range/borrowed_range.subsumption.compile.pass.cpp
libcxx/test/std/ranges/range.req/range.range/enable_borrowed_range.compile.pass.cpp
libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
libcxx/test/std/strings/string.view/string.view.deduct/range.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp
libcxx/test/support/test_iterators.h
libcxx/test/support/test_macros.h