These three commits fix PR121061. The first prepares the tests, and then the next two each fix one of the bugs reported in PR121061.
One issue to consider is that the effect of Layout::mapping::operator() is specified to be equivalent to [1]: return ((static_cast<index_type>(i) * stride(P)) + ... + 0); Which doesn't mention `std::move`. I've added std::move, since I believe that's the intended behaviour. [1]: https://eel.is/c++draft/mdspan.layout.left#obs-4 Luc Grosheintz (3): libstdc++: Refactor mdspan tests [PR121061] libstdc++: Fix constraint for custom integer types in mdspan [PR121061] libstdc++: Fix forwarding of custom IndexType in mdspan [PR121061] libstdc++-v3/include/std/mdspan | 42 ++--- .../mdspan/extents/custom_integer.cc | 102 ++++++++---- .../23_containers/mdspan/extents/int_like.h | 30 ---- .../testsuite/23_containers/mdspan/int_like.h | 63 ++++++++ .../23_containers/mdspan/layouts/mapping.cc | 114 +++++++------- .../23_containers/mdspan/layouts/stride.cc | 21 +-- .../testsuite/23_containers/mdspan/mdspan.cc | 147 ++++++++++++------ 7 files changed, 315 insertions(+), 204 deletions(-) delete mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/int_like.h create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/int_like.h -- 2.50.0