gcc/libstdc++-v3/testsuite/24_iterators
Patrick Palka 2d3142c009 libstdc++: Correctly implement LWG 3946 changes to const_iterator_t [PR122842]
LWG 3946 made const_iterator_t/sentinel_t agree with ranges::cbegin/cend
by defining the aliases in terms of the CPOs, but I defined it the other
way around in an incorrect way that made the aliases not consider
range-ness of const T via __possibly_const_range.  This patch
reimplements the proposed resolution in a more obviously correct way,
mirroring the wording.

	PR libstdc++/122842

libstdc++-v3/ChangeLog:

	* include/bits/ranges_base.h (__access:_CBegin): Define in
	terms of const_iterator directly, not const_iterator_t.
	(__access::_CEnd): Likewise in terms of const_sentinel vs
	const_sentinel_t.
	(const_iterator_t): Move down definition and define in terms
	of ranges::cbegin as per LWG 3946.
	(const_sentinel_t): Likewise in terms of ranges::cend.
	* testsuite/24_iterators/const_iterator/1.cc (test02): Correct
	test for int[], std::array and std::vector.  Also test
	std::string.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2025-11-28 15:38:04 -05:00
..
associated_types Update copyright years. 2025-01-02 11:59:57 +01:00
back_insert_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
bidirectional Update copyright years. 2025-01-02 11:59:57 +01:00
common_iterator libstdc++: Add testcases for resolved bug [PR101527] 2025-03-24 21:38:07 +00:00
const_iterator libstdc++: Correctly implement LWG 3946 changes to const_iterator_t [PR122842] 2025-11-28 15:38:04 -05:00
contiguous Update copyright years. 2025-01-02 11:59:57 +01:00
counted_iterator libstdc++: Add testcases for resolved bug [PR101527] 2025-03-24 21:38:07 +00:00
customization_points libstdc++: Fix std::ranges::iter_move for function references [PR119469] 2025-03-27 11:14:52 +00:00
forward Update copyright years. 2025-01-02 11:59:57 +01:00
front_insert_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
headers/iterator libstdc++: Add conditional noexcept to remaining range access functions 2025-02-15 10:58:56 +00:00
indirect_callable Revert "libstdc++: Optimize std::projected<I, std::identity>" [PR119888] 2025-04-22 12:52:34 -04:00
input Update copyright years. 2025-01-02 11:59:57 +01:00
insert_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
istream_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
istreambuf_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
move_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
normal_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
operations libstdc++: Teach std::distance and std::advance about C++20 iterators [PR102181] 2025-07-28 17:04:04 +02:00
ostream_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
ostreambuf_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
output Update copyright years. 2025-01-02 11:59:57 +01:00
random_access libstdc++: Restore call to test6642 in string_vector_iterators.cc test [PR104874] 2025-08-19 11:03:15 +02:00
range_access Update copyright years. 2025-01-02 11:59:57 +01:00
range_generators c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294] 2025-07-25 08:18:45 +10:00
range_operations libstdc++: Avoid incrementing input iterators with std::prev [PR122224] 2025-10-22 14:48:04 +01:00
reverse_iterator Update copyright years. 2025-01-02 11:59:57 +01:00
aliases.cc Update copyright years. 2025-01-02 11:59:57 +01:00
container_access.cc Update copyright years. 2025-01-02 11:59:57 +01:00