diff options
| -rw-r--r-- | libcxx/include/locale | 2 | ||||
| -rw-r--r-- | libcxx/include/sstream | 2 | ||||
| -rw-r--r-- | libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/include/locale b/libcxx/include/locale index f16d4ba1f99..c3c05eb39b0 100644 --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -546,7 +546,7 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex __exp = 'P'; else if ((__x & 0x5F) == __exp) { - __exp |= 0x80; + __exp |= (char) 0x80; if (__in_units) { __in_units = false; diff --git a/libcxx/include/sstream b/libcxx/include/sstream index 71204e0fadd..14c91971c2f 100644 --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -558,7 +558,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c) char_type* __p = const_cast<char_type*>(__str_.data()); this->setg(__p, __p + __ninp, __hm_); } - return this->sputc(__c); + return this->sputc(traits_type::to_char_type(__c)); } return traits_type::not_eof(__c); } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp index b8fa28ddb28..392a1680e5c 100644 --- a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp @@ -58,4 +58,9 @@ int main() ss << i << ' ' << 321; assert(ss.str() == L"89 3219 "); } + { + std::stringstream ss; + ss.write("\xd1", 1); + assert(ss.str().length() == 1); + } } |

