gcc/libstdc++-v3/testsuite
Jonathan Wakely 2a0f6c61b4 libstdc++: Fix weakly_incrementable to allow __int128 (PR 93267)
The __iota_diff_t alias can be the type __int128, but that does not
satisfy the signed_integral and __is_signed_integer_like concepts when
__STRICT_ANSI__ is defined (which is true for -std=c++2a).

Because weakly_incrementable is defined in terms of signed_integral, it
is not satisfied by __int128, which means iota_view's iterator doesn't
always satisfy input_or_output_iterator and so iota_view is not always a
range.

The solution is to define __max_size_type and __max_diff_type using
__int128, so that __is_signed_integer_like allows __int128, and then
make weakly_incrementable use __is_signed_integer_like instead of
signed_integral.

	PR libstdc++/93267
	* include/bits/iterator_concepts.h (__max_diff_type, __max_size_type):
	Move here from <bits/range_access.h> and define using __int128 when
	available.
	(__is_integer_like, __is_signed_integer_like): Move here from
	<bits/range_access.h>.
	(weakly_incrementable): Use __is_signed_integer_like.
	* include/bits/range_access.h (__max_diff_type, __max_size_type)
	(__is_integer_like, __is_signed_integer_like): Move to
	<bits/iterator_concepts.h>.
	(__make_unsigned_like_t): Move here from <ranges>.
	* include/std/ranges (__make_unsigned_like_t): Move to
	<bits/range_access.h>.
	(iota_view): Replace using-directive with using-declarations.
	* testsuite/std/ranges/iota/93267.cc: New test.
	* testsuite/std/ranges/iota_view.cc: Move to new 'iota' sub-directory.
2020-01-15 16:22:49 +00:00
..
17_intro Update copyright years. 2020-01-01 12:51:42 +01:00
18_support libstdc++: Fix testsuite failures and warnings due to is_pod deprecation 2020-01-09 21:31:50 +00:00
19_diagnostics Update copyright years. 2020-01-01 12:51:42 +01:00
20_util libstdc++: Fix testsuite failures and warnings due to is_pod deprecation 2020-01-09 21:31:50 +00:00
21_strings Update copyright years. 2020-01-01 12:51:42 +01:00
22_locale Update copyright years. 2020-01-01 12:51:42 +01:00
23_containers PR libstdc++/92124 fix incorrect unordered container move assignment 2020-01-09 05:40:08 +00:00
24_iterators libstdc++: Make istreambuf_iterator base class consistent (PR92285) 2020-01-10 15:27:39 +00:00
25_algorithms libstdc++: Fix testcase for C++98 compatibility 2020-01-10 15:27:50 +00:00
26_numerics libstdc++: Fix undefined behaviour in random dist serialization (PR93205) 2020-01-09 16:50:51 +00:00
27_io libstdc++: Ensure root-dir converted to forward slash (PR93244) 2020-01-13 13:22:48 +00:00
28_regex Update copyright years. 2020-01-01 12:51:42 +01:00
29_atomics libstdc++: Value-initialize std::atomic for C++20 (P0883R2) 2020-01-13 13:22:28 +00:00
30_threads Rename condition_variable_any wait* methods to match current draft standard 2020-01-08 03:00:40 +00:00
abi Update copyright years. 2020-01-01 12:51:42 +01:00
backward Update copyright years. 2020-01-01 12:51:42 +01:00
config Update copyright years. 2020-01-01 12:51:42 +01:00
data
decimal Update copyright years. 2020-01-01 12:51:42 +01:00
experimental libstdc++: Fix testsuite failures and warnings due to is_pod deprecation 2020-01-09 21:31:50 +00:00
ext Update copyright years. 2020-01-01 12:51:42 +01:00
lib Update copyright years. 2020-01-01 12:51:42 +01:00
libstdc++-abi Update copyright years. 2020-01-01 12:51:42 +01:00
libstdc++-dg Update copyright years. 2020-01-01 12:51:42 +01:00
libstdc++-prettyprinters Update copyright years. 2020-01-01 12:51:42 +01:00
libstdc++-xmethods Update copyright years. 2020-01-01 12:51:42 +01:00
performance Update copyright years. 2020-01-01 12:51:42 +01:00
special_functions Update copyright years. 2020-01-01 12:51:42 +01:00
std libstdc++: Fix weakly_incrementable to allow __int128 (PR 93267) 2020-01-15 16:22:49 +00:00
tr1 Update copyright years. 2020-01-01 12:51:42 +01:00
tr2 Update copyright years. 2020-01-01 12:51:42 +01:00
util libstdc++: Value-initialize std::atomic for C++20 (P0883R2) 2020-01-13 13:22:28 +00:00
Makefile.am Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.in Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00