https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104032

            Bug ID: 104032
           Summary: Cannot move-assign a spanstream
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

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);
      |       ^~~~~~~~~~~~~

Reply via email to