Jonathan Wakely
c351a240ad
libstdc++: Make ranges::distance work with volatile iterators (LWG 4242)
...
This implements LWG 4242 which was approved in Sofia 2025.
I don't think the change from static_cast<const decay_t<I>&> to just
static_cast<decay_t<I>> is observable, but it doesn't hurt. What fixes
the problem identified in the issue is the is_array_v check, which
avoids the static_cast entirely for volatile-qualified iterators.
libstdc++-v3/ChangeLog:
* include/bits/ranges_base.h (distance(It&&, Sent)): Only decay
arrays to pointers when the type is actually an array, as per
LWG 4242.
* testsuite/24_iterators/range_operations/distance.cc: Add test
for LWG 4242.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com >
2026-03-16 22:04:23 +00:00
..
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-10 13:38:23 -04:00
2026-01-02 09:56:11 +01:00
2026-03-16 15:17:45 +00:00
2026-02-26 21:11:07 +08:00
2026-01-02 09:56:11 +01:00
2026-01-09 19:18:21 +00:00
2026-03-09 16:44:11 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-10 10:33:45 +00:00
2026-02-16 18:26:35 +01:00
2025-12-05 12:15:08 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2025-12-19 14:00:07 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-10 10:05:30 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-19 10:17:47 +01:00
2025-12-11 19:54:44 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-06 11:35:24 +01:00
2026-01-02 09:56:11 +01:00
2026-02-11 17:54:09 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-11 17:54:09 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-04 03:59:15 -05:00
2026-03-04 03:59:15 -05:00
2026-01-02 09:56:11 +01:00
2025-10-08 17:06:20 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-15 10:17:43 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-10 13:38:23 -04:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-16 15:17:45 +00:00
2026-01-07 15:07:33 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-09 20:43:16 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-10 18:22:28 +00:00
2026-01-02 09:56:11 +01:00
2026-03-16 22:04:23 +00:00
2026-01-19 12:09:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-03 12:05:49 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-09 20:04:12 -05:00
2026-02-12 15:17:57 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-09 20:04:12 -05:00
2026-02-11 11:00:03 +00:00
2025-12-08 18:55:02 +00:00
2026-01-09 19:18:21 +00:00
2026-01-02 09:56:11 +01:00
2026-01-28 10:28:09 +00:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-07 15:07:33 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-02-11 17:54:09 +01:00
2026-01-13 19:14:26 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-04 03:59:15 -05:00
2026-02-04 17:39:51 -05:00
2026-02-04 17:39:51 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-04 03:59:15 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-04 03:59:15 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2025-10-08 18:02:39 +02:00
2025-11-14 18:27:01 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-04 03:59:15 -05:00
2026-03-04 03:59:15 -05:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-03-10 13:38:23 -04:00
2026-03-10 13:38:23 -04:00
2026-01-02 09:56:11 +01:00