[PATCH] libstdc++: Add more template keywords to <mdspan> for Clang
Tomasz Kaminski
tkaminsk@redhat.com
Mon Jul 14 08:15:31 GMT 2025
I was going to ask why you haven't committed it directly, but it looks like
it is already on master.
LGTM.
On Tue, Jul 8, 2025 at 11:34 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> This fixes:
>
> include/c++/16.0.0/mdspan:1182:33: error: use 'template' keyword to treat
> 'mapping' as a dependent template name
> 1182 | const typename _OLayout::mapping<_OExtents>&>
> | ^
> include/c++/16.0.0/mdspan:1185:31: error: use 'template' keyword to treat
> 'mapping' as a dependent template name
> 1185 | const typename _OLayout::mapping<_OExtents>&,
> mapping_type>
> | ^
>
> libstdc++-v3/ChangeLog:
>
> * include/std/mdspan (mdspan): Add template keyword for
> dependent name.
> ---
>
> Tested x86_64-linux.
>
> libstdc++-v3/include/std/mdspan | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/mdspan
> b/libstdc++-v3/include/std/mdspan
> index 5d16de5d9072..b34116a85e67 100644
> --- a/libstdc++-v3/include/std/mdspan
> +++ b/libstdc++-v3/include/std/mdspan
> @@ -1179,10 +1179,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> template<typename _OElementType, typename _OExtents, typename
> _OLayout,
> typename _OAccessor>
> requires is_constructible_v<mapping_type,
> - const typename _OLayout::mapping<_OExtents>&>
> + const typename _OLayout::template mapping<_OExtents>&>
> && is_constructible_v<accessor_type, const _OAccessor&>
> constexpr explicit(!is_convertible_v<
> - const typename _OLayout::mapping<_OExtents>&, mapping_type>
> + const typename _OLayout::template mapping<_OExtents>&,
> mapping_type>
> || !is_convertible_v<const _OAccessor&, accessor_type>)
> mdspan(const mdspan<_OElementType, _OExtents, _OLayout,
> _OAccessor>&
> __other)
> --
> 2.50.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250714/9bad3df8/attachment.htm>
More information about the Libstdc++
mailing list