https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121061

--- Comment #1 from Tomasz KamiƄski <tkaminsk at gcc dot gnu.org> ---
This is due incorrect constrain on corresponding constructor:
   template<__mdspan::__valid_index_type<index_type> _OIndexType, size_t _Nm>
        requires (_Nm == rank() || _Nm == rank_dynamic())
        constexpr explicit(_Nm != rank_dynamic())
        extents(span<_OIndexType, _Nm> __exts) noexcept
        : _M_exts(span<const _OIndexType, _Nm>(__exts))
        { }
We check `__mdspan::__valid_index_type<_OtherIndex, index_type>`, while we we
should check `__mdspan::__valid_index_type<const _OtherIndex&, index_type>`,
i.e.:
  template<typename _OIndexType, size_t _Nm>
        requires 
         __mdspan::__valid_index_type<const _OIndexType&, index_type>
         (_Nm == rank() || _Nm == rank_dynamic())
        constexpr explicit(_Nm != rank_dynamic())
        extents(span<_OIndexType, _Nm> __exts) noexcept
        : _M_exts(span<const _OIndexType, _Nm>(__exts))
        { }
Similary for the array constructor, and the constructors of mdspan.

Reply via email to