gcc/libstdc++-v3/include/std
Jonathan Wakely 6c2582c040 libstdc++: Fix view adaptors for mixed-const sentinels and iterators (PR 95322)
The bug report is that transform_view's sentinel<false> cannot be
compared to its iterator<true>.  The comparison is supposed to use
operator==(iterator<Const>, sentinel<Const>) after converting
sentinel<false> to sentinel<true>. However, the operator== is a hidden
friend so is not a candidate when comparing iterator<true> with
sentinel<false>. The required conversion would only happen if we'd found
the operator, but we can't find the operator until after the conversion
happens.

A new LWG issue has been reported, but not yet assigned a number.  The
solution suggested by Casey Carter is to make the hidden friends of the
sentinel types work with iterators of any const-ness, so that no
conversions are required.

Patrick Palka observed that join_view has a similar problem and a
similar fix is used for its sentinel.

	PR libstdc++/95322
	* include/std/ranges (transform_view::_Sentinel): Allow hidden
	friends to work with _Iterator<true> and _Iterator<false>.
	(join_view::_Sentinel): Likewise.
	* testsuite/std/ranges/adaptors/95322.cc: New test.
2020-05-27 22:08:15 +01:00
..
algorithm libstdc++: Implement C++20 constrained algorithms 2020-02-06 20:08:34 -05:00
any libstdc++: Fix constructor constraints for std::any (PR 90415) 2020-04-24 00:54:20 +01:00
array Update copyright years. 2020-01-01 12:51:42 +01:00
atomic libstdc++: Add missing feature test macros 2020-04-22 22:54:34 +01:00
bit libstdc++ P1956R1 On the names of low-level bit manipulation functions 2020-02-17 17:09:18 +00:00
bitset libstdc++: Add comparison operators to types from Utilities clause 2020-04-15 19:47:48 +01:00
charconv libstdc++: Add comparison operators to <charconv> result types 2020-04-08 16:16:10 +01:00
chrono libstdc++: Add comparison operators to <chrono> types 2020-04-18 00:47:45 +01:00
codecvt Update copyright years. 2020-01-01 12:51:42 +01:00
complex libstdc++: Add comparison operators to types from Numerics clause 2020-04-08 16:51:59 +01:00
concepts libstdc++: Update __cpp_lib_concepts value 2020-04-22 22:54:34 +01:00
condition_variable libstdc++: Update value of __cpp_lib_jthread macro 2020-04-22 22:54:34 +01:00
coroutine coroutines: Fix handling of non-class coroutine returns [PR94759] 2020-04-28 02:07:37 +01:00
deque libstdc++: Update __cpp_lib_erase_if macro (P1115R3) 2020-02-15 10:25:23 +00:00
execution libstdc++: Define __cpp_lib_execution feature test macro 2020-04-22 22:54:35 +01:00
filesystem Update copyright years. 2020-01-01 12:51:42 +01:00
forward_list libstdc++: Update __cpp_lib_erase_if macro (P1115R3) 2020-02-15 10:25:23 +00:00
fstream Update copyright years. 2020-01-01 12:51:42 +01:00
functional libstdc++: Rename __cpp_lib_constexpr_invoke macro 2020-04-22 22:54:34 +01:00
future libstdc++: Define and use chrono::is_clock for C++20 2020-03-25 22:07:02 +00:00
iomanip Update copyright years. 2020-01-01 12:51:42 +01:00
ios Update copyright years. 2020-01-01 12:51:42 +01:00
iosfwd Update copyright years. 2020-01-01 12:51:42 +01:00
iostream Update copyright years. 2020-01-01 12:51:42 +01:00
istream Update copyright years. 2020-01-01 12:51:42 +01:00
iterator Update copyright years. 2020-01-01 12:51:42 +01:00
limits Update copyright years. 2020-01-01 12:51:42 +01:00
list libstdc++: Update __cpp_lib_erase_if macro (P1115R3) 2020-02-15 10:25:23 +00:00
locale Update copyright years. 2020-01-01 12:51:42 +01:00
map Update copyright years. 2020-01-01 12:51:42 +01:00
memory libstdc++: Add missing feature test macros 2020-04-22 22:54:34 +01:00
memory_resource libstdc++: Add missing feature test macros 2020-04-22 22:54:34 +01:00
mutex libstdc++: Define and use chrono::is_clock for C++20 2020-03-25 22:07:02 +00:00
numbers Update copyright years. 2020-01-01 12:51:42 +01:00
numeric libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
optional libstdc++: Define <=> for tuple, optional and variant 2020-02-21 17:12:39 +00:00
ostream Update copyright years. 2020-01-01 12:51:42 +01:00
queue Update copyright years. 2020-01-01 12:51:42 +01:00
random Update copyright years. 2020-01-01 12:51:42 +01:00
ranges libstdc++: Fix view adaptors for mixed-const sentinels and iterators (PR 95322) 2020-05-27 22:08:15 +01:00
ratio Update copyright years. 2020-01-01 12:51:42 +01:00
regex Update copyright years. 2020-01-01 12:51:42 +01:00
scoped_allocator libstdc++: Add comparison operators to types from Utilities clause 2020-04-15 19:47:48 +01:00
set Update copyright years. 2020-01-01 12:51:42 +01:00
shared_mutex libstdc++: Define and use chrono::is_clock for C++20 2020-03-25 22:07:02 +00:00
span libstdc++: enable_view has false positives (LWG 3326) 2020-02-24 12:15:05 +00:00
sstream Update copyright years. 2020-01-01 12:51:42 +01:00
stack Update copyright years. 2020-01-01 12:51:42 +01:00
stdexcept Update copyright years. 2020-01-01 12:51:42 +01:00
stop_token libstdc++: Update value of __cpp_lib_jthread macro 2020-04-22 22:54:34 +01:00
streambuf Update copyright years. 2020-01-01 12:51:42 +01:00
string libstdc++: Update __cpp_lib_erase_if macro (P1115R3) 2020-02-15 10:25:23 +00:00
string_view libstdc++: Fixes for feature test macros (PR 91480) 2020-04-28 23:40:18 +01:00
system_error libstdc++: Define operator<=> for <system_error> types 2020-02-20 12:27:48 +00:00
thread libstdc++: Define and use chrono::is_clock for C++20 2020-03-25 22:07:02 +00:00
tuple libstdc++: Fixes for feature test macros (PR 91480) 2020-04-28 23:40:18 +01:00
type_traits libstdc++: Replace reserved identifier _T with _Tp (PR 94901) 2020-05-01 13:41:02 +01:00
typeindex libstdc++: Add spaceship operator to std::type_index 2020-04-15 19:47:47 +01:00
unordered_map Update copyright years. 2020-01-01 12:51:42 +01:00
unordered_set Update copyright years. 2020-01-01 12:51:42 +01:00
utility libstdc++: Do not define __cpp_lib_constexpr_algorithms in <utility> 2020-04-22 22:54:35 +01:00
valarray Update copyright years. 2020-01-01 12:51:42 +01:00
variant libstdc++: Define <=> for tuple, optional and variant 2020-02-21 17:12:39 +00:00
vector libstdc++: Update __cpp_lib_erase_if macro (P1115R3) 2020-02-15 10:25:23 +00:00
version Implent C++20 std::atomic_flag::test 2020-05-12 07:37:09 +02:00