https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117966
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:83fa0822aeec8af2162825976209efb90ca40c87 commit r14-11180-g83fa0822aeec8af2162825976209efb90ca40c87 Author: Jonathan Wakely <jwak...@redhat.com> Date: Mon Dec 9 17:35:24 2024 +0000 libstdc++: Skip redundant assertions in std::span construction [PR117966] As PR c++/117966 shows, the Debug Mode checks cause a compilation error for a global constexpr std::span. Those debug checks are redundant when constructing from an array or a range, because we already know we have a valid range and we know its size. Instead of delegating to the std::span(contiguous_iterator, contiguous_iterator) constructor, just initialize the data members directly. libstdc++-v3/ChangeLog: PR libstdc++/117966 * include/std/span (span(T (&)[N])): Do not delegate to constructor that performs redundant checks. (span(array<T, N>&), span(const array<T, N>&)): Likewise. (span(Range&&), span(const span<T, N>&)): Likewise. * testsuite/23_containers/span/117966.cc: New test. (cherry picked from commit e95bda027e0b81922c1bf44770674190bdf787e8)