From: Luc Grosheintz Date: Mon, 8 Dec 2025 20:23:40 +0000 (+0100) Subject: libstdc++: Silence warning in mdspan. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64d5e1eb97f198c9377c393d648c8db2617a80d0;p=thirdparty%2Fgcc.git libstdc++: Silence warning in mdspan. Splitting the tests for submdspan triggered a compiler warning. This commit changes the implementation of __dynamic_extents. In particular, how the span is created. Functionally, the two are equivalent. libstdc++-v3/ChangeLog: * include/std/mdspan (_ExtentsStorage::_M_dynamic_extents): Create span from pointer + size, not begin and end iterators. 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 981fa1c601a..f0f6630b472 100644 --- a/libstdc++-v3/include/std/mdspan +++ b/libstdc++-v3/include/std/mdspan @@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION requires (_Extents.size() > 0) { return {_M_dyn_exts + _S_dynamic_index(__begin), - _M_dyn_exts + _S_dynamic_index(__end)}; + _S_dynamic_index(__end) - _S_dynamic_index(__begin)}; } private: