[all-commits] [llvm/llvm-project] 8825ce: [libc++][ranges] Mark LWG4242 as Resolved (#211568)

Lucas Mellone via All-commits all-commits at lists.llvm.org
Sun Aug 9 09:20:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8825ce4c6c1213784075bc54909f837d36ab81fa
      https://github.com/llvm/llvm-project/commit/8825ce4c6c1213784075bc54909f837d36ab81fa
  Author: Lucas Mellone <github.snugness349 at passinbox.com>
  Date:   2026-08-10 (Mon, 10 Aug 2026)

  Changed paths:
    M libcxx/docs/Status/Cxx26Issues.csv
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp

  Log Message:
  -----------
  [libc++][ranges] Mark LWG4242 as Resolved (#211568)

Closes https://github.com/llvm/llvm-project/issues/148224

The current implementation for the `ranges::distance(I&& first, S last)`
overload already sidesteps the `volatile first` with condition
`sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>`.

In the commit initially implementing `ranges::distance`
(c965d5448ecdf9a5513983862a78a2ba8f7fbab8), the condition was
`sized_sentinel_for<_Sp, __uncvref_t<_Ip>>` and `__uncvref_t` was just
renamed to `__remove_cvref_t` later. Also, given the overload has been
constrained with `sized_sentinel_for<_Sp, decay_t<_Ip>>`, the condition
always gives the same results as `!is_array_v<remove_reference_t<_Ip>>`
that is indicated by the resolution of LWG4242. So it can be considered
that LWG4242 was implemented in libc++ in LLVM 14.

This commit marks LWG4242 as Resolved and organises the test suite to
better represent both LWG3664 and LWG4242 tests in
`libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp`.

References:
- [LWG4242](https://cplusplus.github.io/LWG/issue4242)
- https://eel.is/c++draft/range.iter.op.distance

Follows-up: https://github.com/llvm/llvm-project/pull/210550



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list