]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for 4314 in <mdspan>.
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Wed, 3 Sep 2025 15:28:27 +0000 (17:28 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Thu, 4 Sep 2025 09:55:02 +0000 (11:55 +0200)
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>
libstdc++-v3/include/std/mdspan

index 6c7469cd2d80c87b597d837f0d871787965930e2..678b2619ebe4bf10c33079ae59cc999b2ec9198e 100644 (file)
@@ -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>)