From: Luc Grosheintz Date: Mon, 11 Aug 2025 20:14:54 +0000 (+0200) Subject: libstdc++: Reduce size static storage for __fwd_prod in mdspan. X-Git-Tag: basepoints/gcc-17~5484 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6ed0658f70144dbec0fe7c494cf7a2a11b05d2e;p=thirdparty%2Fgcc.git libstdc++: Reduce size static storage for __fwd_prod in mdspan. This fixes an oversight in a previous commit that improved mdspan related code. Because __size doesn't use __fwd_prod, __fwd_prod(__rank) is not needed anymore. Hence, one can shrink the size of __fwd_partial_prods. libstdc++-v3/ChangeLog: * include/std/mdspan (__fwd_partial_prods): Reduce size of the array by 1 element. Reviewed-by: Tomasz KamiƄski Signed-off-by: Luc Grosheintz --- diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index 351018a59a5..8f974257e96 100644 --- a/libstdc++-v3/include/std/mdspan +++ b/libstdc++-v3/include/std/mdspan @@ -274,8 +274,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr auto __fwd_partial_prods = [] consteval { constexpr size_t __rank = _Extents.size(); - std::array __ret; - for(size_t __r = 0; __r < __rank + 1; ++__r) + std::array __ret; + for(size_t __r = 0; __r < __rank; ++__r) __ret[__r] = __static_prod<_Extents>(0, __r); return __ret; }();