Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions stl/inc/mdspan
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public:

template <class _OtherExtents>
requires is_constructible_v<extents_type, _OtherExtents>
constexpr explicit(extents_type::rank() > 0)
constexpr explicit(!(extents_type::rank() == 0 && is_convertible_v<_OtherExtents, extents_type>) )
mapping(const layout_stride::mapping<_OtherExtents>& _Other) noexcept // strengthened
: _Base(_Other.extents()) {
#if _ITERATOR_DEBUG_LEVEL != 0
Expand Down Expand Up @@ -693,7 +693,8 @@ public:

template <class _OtherExtents>
requires is_constructible_v<extents_type, _OtherExtents>
constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping<_OtherExtents>& _Other) noexcept
constexpr explicit(!(extents_type::rank() == 0 && is_convertible_v<_OtherExtents, extents_type>) )
mapping(const layout_stride::mapping<_OtherExtents>& _Other) noexcept
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change requested: layout_left::mapping and layout_right::mapping vary in their noexcept // strengthened vs. noexcept, but this matches the Standard's varying noexcept, despite the fact that they both have preconditions. I think this should be an LWG issue (but am too lazybusy to report it).

: _Base(_Other.extents()) {
#if _ITERATOR_DEBUG_LEVEL != 0
if constexpr (extents_type::rank() > 0) {
Expand Down
4 changes: 4 additions & 0 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ std/ranges/range.adaptors/range.join/range.join.iterator/arrow.pass.cpp FAIL
std/containers/views/mdspan/layout_stride/is_exhaustive_corner_case.pass.cpp FAIL
std/containers/views/mdspan/layout_stride/properties.pass.cpp FAIL

# libc++ doesn't implement LWG-4272 "For `rank == 0`, `layout_stride` is atypically convertible"
std/containers/views/mdspan/layout_left/ctor.layout_stride.pass.cpp FAIL
std/containers/views/mdspan/layout_right/ctor.layout_stride.pass.cpp FAIL

# If any feature-test macro test is failing, this consolidated test will also fail.
std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp FAIL

Expand Down
2 changes: 2 additions & 0 deletions tests/std/tests/P0009R18_mdspan_layout_left/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ constexpr void check_construction_from_other_stride_mapping() {
layout_stride::mapping<extents<long long, 3>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_left::mapping<extents<int, 3>>,
layout_stride::mapping<extents<int, dynamic_extent>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_left::mapping<extents<int>>,
layout_stride::mapping<extents<long long>>>);
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/std/tests/P0009R18_mdspan_layout_right/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ constexpr void check_construction_from_other_stride_mapping() {
layout_stride::mapping<extents<long long, 3>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_right::mapping<extents<int, 3>>,
layout_stride::mapping<extents<int, dynamic_extent>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_right::mapping<extents<int>>,
layout_stride::mapping<extents<long long>>>);
}
}

Expand Down