<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - std::basic_stringstream is not working with std::byte"
href="https://bugs.llvm.org/show_bug.cgi?id=40270">40270</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::basic_stringstream is not working with std::byte
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mail@hanicka.net
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=21307" name="attach_21307" title="source code to emit the error">attachment 21307</a> <a href="attachment.cgi?id=21307&action=edit" title="source code to emit the error">[details]</a></span>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>