[gcc r16-3566] libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for 4314 in <mdspan>.
Tomasz Kaminski
tkaminsk@gcc.gnu.org
Thu Sep 4 09:55:15 GMT 2025
https://gcc.gnu.org/g:43a8c0f8e67f282823a3af1df4cd77dd86981b9c
commit r16-3566-g43a8c0f8e67f282823a3af1df4cd77dd86981b9c
Author: Luc Grosheintz <luc.grosheintz@gmail.com>
Date: Wed Sep 3 17:28:27 2025 +0200
libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for 4314 in <mdspan>.
In r16-2328-g29d53f6213e0a1 we fixed a bug related to user-defined
objects that can convert to an integers only via an rvalue reference.
The same commit also implemented LWG 4314 [1], but didn't mark it with
_GLIBCXX_RESOLVE_LIB_DEFECTS. This commit adds the missing markers.
[1]: https://cplusplus.github.io/LWG/issue4314
It also fixes one cases of trailing white-space near a ctor for
aligned_accessor.
libstdc++-v3/ChangeLog:
* include/std/mdspan (layout_left::mapping::operator()): Add
_GLIBCXX_RESOLVE_LIB_DEFECTS marker for 4314.
(layout_left::mapping::operator()): Ditto.
(layout_stride::mapping::operator()): Ditto.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
Diff:
---
libstdc++-v3/include/std/mdspan | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan
index 6c7469cd2d80..678b2619ebe4 100644
--- a/libstdc++-v3/include/std/mdspan
+++ b/libstdc++-v3/include/std/mdspan
@@ -727,6 +727,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
required_span_size() const noexcept
{ return __mdspan::__size(_M_extents); }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 4314. Missing move in mdspan layout mapping::operator()
template<__mdspan::__valid_index_type<index_type>... _Indices>
requires (sizeof...(_Indices) == extents_type::rank())
constexpr index_type
@@ -866,6 +868,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
required_span_size() const noexcept
{ return __mdspan::__size(_M_extents); }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 4314. Missing move in mdspan layout mapping::operator()
template<__mdspan::__valid_index_type<index_type>... _Indices>
requires (sizeof...(_Indices) == extents_type::rank())
constexpr index_type
@@ -1089,6 +1093,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __ret;
}
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 4314. Missing move in mdspan layout mapping::operator()
template<__mdspan::__valid_index_type<index_type>... _Indices>
requires (sizeof...(_Indices) == extents_type::rank())
constexpr index_type
@@ -1208,7 +1214,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
aligned_accessor() noexcept = default;
template<typename _OElementType, size_t _OByteAlignment>
- requires (_OByteAlignment >= byte_alignment)
+ requires (_OByteAlignment >= byte_alignment)
&& is_convertible_v<_OElementType(*)[], element_type(*)[]>
constexpr
aligned_accessor(aligned_accessor<_OElementType, _OByteAlignment>)
More information about the Libstdc++-cvs
mailing list