https://godbolt.org/z/GxdYrYYrj ==== #include <spanstream> int main() { std::ispanstream a(""), b(""); a = std::move(b); } ==== In file included from <source>:1: /opt/compiler-explorer/gcc-trunk-20220114/include/c++/12.0.0/spanstream: In instantiation of 'std::basic_spanbuf<_CharT, _Traits>& std::basic_spanbuf<_CharT, _Traits>::operator=(std::basic_spanbuf<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]': /opt/compiler-explorer/gcc-trunk-20220114/include/c++/12.0.0/spanstream:258:24: required from here /opt/compiler-explorer/gcc-trunk-20220114/include/c++/12.0.0/spanstream:89:7: error: base operand of '->' has non-pointer type 'std::basic_spanbuf<char>' 89 | basic_spanbuf(std::move(__rhs))->swap(*this); | ^~~~~~~~~~~~~
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:51631875a2fa0af62ebda7484ac48368e1805dff commit r12-6829-g51631875a2fa0af62ebda7484ac48368e1805dff Author: Jonathan Wakely <jwakely@redhat.com> Date: Sun Jan 23 21:55:57 2022 +0000 libstdc++: Fix std::spanstream move assignment [PR104032] libstdc++-v3/ChangeLog: PR libstdc++/104032 * include/std/spanstream (basic_spanbuf(basic_spanbuf&&)): Use mem-initializer for _M_buf. (basic_spanbuf::Operator=(basic_spanbuf&&)): Fix ill-formed member access. * testsuite/27_io/spanstream/2.cc: New test.
Fixed, thanks for the report.