https://bugs.llvm.org/show_bug.cgi?id=40270

            Bug ID: 40270
           Summary: std::basic_stringstream is not working with std::byte
           Product: libc++
           Version: 7.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 21307
  --> https://bugs.llvm.org/attachment.cgi?id=21307&action=edit
source code to emit the error

I can't compile std::basic_stringstream<std::byte, ByteCharTraits> with only
constructor. GCC accepts this code.

It gives error in basic_stringbuf::allocator on sputc function.



clang++ -stdlib=libc++ byte_stream.cpp -std=c++17




In file included from byte_stream.cpp:1:
/usr/local/Cellar/llvm/7.0.0/include/c++/v1/sstream:562:28: error: cannot
initialize a parameter of type 'std::__1::basic_streambuf<std::byte,
      ByteCharTraits>::char_type' (aka 'std::byte') with an lvalue of type
'std::__1::basic_stringbuf<std::byte, ByteCharTraits,
      std::__1::allocator<std::byte> >::int_type' (aka 'int')
        return this->sputc(__c);
                           ^~~
/usr/local/Cellar/llvm/7.0.0/include/c++/v1/sstream:866:28: note: in
instantiation of member function 'std::__1::basic_stringbuf<std::byte,
      ByteCharTraits, std::__1::allocator<std::byte> >::overflow' requested
here
class _LIBCPP_TEMPLATE_VIS basic_stringstream
                           ^
/usr/local/Cellar/llvm/7.0.0/include/c++/v1/streambuf:221:30: note: passing
argument to parameter '__c' here
    int_type sputc(char_type __c) {
                             ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to