gcc/libstdc++-v3/testsuite/experimental
Jonathan Wakely 6d0dff49ca Add iterator concepts and range access customization points for C++20
This adds most of the new C++20 features to <iterator>, as well as a few
initial pieces of <ranges> (but no actual <ranges> header just yet).

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/iterator_concepts.h: New header.
	(contiguous_iterator_tag, iter_reference_t, ranges::iter_move)
	(iter_rvalue_reference_t, incrementable_traits, iter_difference_t)
	(readable_traits, iter_value_t, readable, iter_common_reference_t)
	(writable, waekly_incrementable, incrementable)
	(input_or_output_iterator, sentinel_for, disable_sized_sentinel)
	(sized_sentinel_for, input_iterator, output_iterator)
	(forward_iterator, bidirectional_iterator, random_access_iterator)
	(contiguous_iterator, indirectly_unary_invocable)
	(indirectly_regular_unary_invocable, indirect_unary_predicate)
	(indirect_relation, indirect_strict_weak_order, indirect_result_t)
	(projected, indirectly_movable, indirectly_movable_storable)
	(indirectly_copyable, indirectly_copyable_storable, ranges::iter_swap)
	(indirectly_swappable, indirectly_comparable, permutable, mergeable)
	(sortable, unreachable_sentinel_t, unreachable_sentinel)
	(default_sentinel_t, default_sentinel): Define.
	(__detail::__cpp17_iterator, __detail::__cpp17_input_iterator)
	(__detail::__cpp17_fwd_iterator, __detail::__cpp17_bidi_iterator)
	(__detail::__cpp17_randacc_iterator): Define.
	(__iterator_traits): Define constrained specializations.
	* include/bits/move.h (move): Only use old concept check for C++98.
	* include/bits/range_access.h (ranges::disable_sized_range)
	(ranges::begin, ranges::end, ranges::cbegin, ranges::cend)
	(ranges::rbegin, ranges::rend, ranges::crbegin, ranges::crend)
	(ranges::size, ranges::empty, ranges::data, ranges::cdata): Define
	new customization points for C++20.
	(ranges::range, ranges::sized_range): Define new concepts for C++20.
	(ranges::advance, ranges::distance, ranges::next, ranges::prev):
	Define new functions for C++20.
	(__adl_end, __adl_cdata, __adl_cbegin, __adl_cend, __adl_rbegin)
	(__adl_rend, __adl_crbegin, __adl_crend, __adl_cdata, __adl_size)
	(__adl_empty): Remove.
	* include/bits/stl_iterator.h (disable_sized_sentinel): Specialize
	for reverse_iterator.
	* include/bits/stl_iterator_base_types.h (contiguous_iterator_tag):
	Define new struct for C++20.
	(iterator_traits<_Tp*>): Constrain partial specialization in C++20.
	* include/std/concepts (__is_class_or_enum): Move to __detail
	namespace.
	* testsuite/20_util/forward/c_neg.cc: Adjust dg-error line number.
	* testsuite/20_util/forward/f_neg.cc: Likewise.
	* testsuite/24_iterators/associated_types/incrementable.traits.cc: New
	test.
	* testsuite/24_iterators/associated_types/readable.traits.cc: New test.
	* testsuite/24_iterators/contiguous/concept.cc: New test.
	* testsuite/24_iterators/contiguous/tag.cc: New test.
	* testsuite/24_iterators/customization_points/iter_move.cc: New test.
	* testsuite/24_iterators/customization_points/iter_swap.cc: New test.
	* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: New test.
	* testsuite/24_iterators/range_operations/advance.cc: New test.
	* testsuite/24_iterators/range_operations/distance.cc: New test.
	* testsuite/24_iterators/range_operations/next.cc: New test.
	* testsuite/24_iterators/range_operations/prev.cc: New test.
	* testsuite/26_numerics/adjacent_difference/requirements/
	explicit_instantiation/2.cc: Rename types that conflict with C++20
	concepts.
	* testsuite/26_numerics/adjacent_difference/requirements/
	explicit_instantiation/pod.cc: Likewise.
	* testsuite/26_numerics/partial_sum/requirements/
	explicit_instantiation/2.cc: Likewise.
	* testsuite/26_numerics/partial_sum/requirements/
	explicit_instantiation/pod.cc: Likewise.
	* testsuite/experimental/iterator/requirements.cc: Likewise.
	* testsuite/std/ranges/access/begin.cc: New test.
	* testsuite/std/ranges/access/cbegin.cc: New test.
	* testsuite/std/ranges/access/cdata.cc: New test.
	* testsuite/std/ranges/access/cend.cc: New test.
	* testsuite/std/ranges/access/crbegin.cc: New test.
	* testsuite/std/ranges/access/crend.cc: New test.
	* testsuite/std/ranges/access/data.cc: New test.
	* testsuite/std/ranges/access/empty.cc: New test.
	* testsuite/std/ranges/access/end.cc: New test.
	* testsuite/std/ranges/access/rbegin.cc: New test.
	* testsuite/std/ranges/access/rend.cc: New test.
	* testsuite/std/ranges/access/size.cc: New test.
	* testsuite/util/testsuite_iterators.h (contiguous_iterator_wrapper)
	(test_range, test_sized_range): New test utilities.

From-SVN: r277579
2019-10-29 17:44:18 +00:00
..
algorithm Update copyright years. 2019-01-01 13:31:55 +01:00
any PR libstdc++/90220 fix experimental::any_cast for non-object types 2019-05-23 14:39:06 +01:00
array Improve docs for Library Fundamentals TS 2019-05-02 16:46:29 +01:00
chrono Update copyright years. 2019-01-01 13:31:55 +01:00
deque Update copyright years. 2019-01-01 13:31:55 +01:00
filesystem PR libstdc++/90281 Fix string conversions for filesystem::path 2019-06-17 15:19:04 +01:00
forward_list Update copyright years. 2019-01-01 13:31:55 +01:00
functional Update copyright years. 2019-01-01 13:31:55 +01:00
iterator Add iterator concepts and range access customization points for C++20 2019-10-29 17:44:18 +00:00
list Update copyright years. 2019-01-01 13:31:55 +01:00
map Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
memory PR c++/90047 - ICE with enable_if alias template. 2019-04-17 23:32:24 -04:00
memory_resource PR libstdc++/77691 fix resource_adaptor failures due to max_align_t bugs 2019-05-22 21:29:39 +01:00
net re PR libstdc++/89461 (FAIL: experimental/net/timer/waitable/cons.cc) 2019-03-12 23:13:36 +00:00
numeric Update copyright years. 2019-01-01 13:31:55 +01:00
optional Remove redundant __constexpr_addressof function 2019-05-02 22:23:35 +01:00
polymorphic_allocator P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
propagate_const Improve docs for Library Fundamentals TS 2019-05-02 16:46:29 +01:00
random Update copyright years. 2019-01-01 13:31:55 +01:00
ratio Update copyright years. 2019-01-01 13:31:55 +01:00
set Update copyright years. 2019-01-01 13:31:55 +01:00
source_location Update copyright years. 2019-01-01 13:31:55 +01:00
string Update copyright years. 2019-01-01 13:31:55 +01:00
string_view Fix basic_string_view typedefs and enforce preconditions 2019-04-24 16:17:53 +01:00
system_error Update copyright years. 2019-01-01 13:31:55 +01:00
tuple Update copyright years. 2019-01-01 13:31:55 +01:00
type_erased_allocator Update copyright years. 2019-01-01 13:31:55 +01:00
type_traits nonesuch is insufficiently useless (lwg2996) 2019-05-14 16:48:27 +01:00
unordered_map Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
unordered_set Update copyright years. 2019-01-01 13:31:55 +01:00
vector Update copyright years. 2019-01-01 13:31:55 +01:00
feat-char8_t.cc Add L suffix to __cpp_lib_char8_t value 2019-03-06 12:13:19 +00:00
feat-cxx14.cc Use dg-do preprocess instead of compile for tests 2016-08-23 11:13:31 +01:00
feat-lib-fund.cc Use dg-do preprocess instead of compile for tests 2016-08-23 11:13:31 +01:00
names.cc Fix tests that fail with -std=gnu++98 or -std=gnu++11 2019-06-06 13:13:42 +01:00