[llvm-bugs] [Bug 40270] New: std::basic_stringstream is not working with std::byte

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 9 08:57:16 PST 2019


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: unassignedclangbugs at nondot.org
          Reporter: mail at hanicka.net
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190109/81c90b4e/attachment-0001.html>


More information about the llvm-bugs mailing list