https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013
Bug ID: 103013 Summary: Underconstrained constructor span(_Range&&) Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: andrey.davydov at jetbrains dot com Target Milestone: --- During calculation of type trait `is_move_constructible<span>` span constructor from `_Range &&` is checked and concept `contiguous_range<span<T>>` instantiated. It requires T to be complete type (https://gcc.godbolt.org/z/fYWa3KdTs). It means that `optional<span<Incomplete>>` couldn't be instantiated (https://gcc.godbolt.org/z/1PWdE4YK3). This issue could be solved if make the constructor span(_Range&&) more constrained, something like this: template<typename _Range> requires (!__is_same(_Range, span)) && ... span(_Range&& __range);