mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00

Given `std::basic_streambuf<CharT>::int_type __c`, `std::basic_string<CharT> str_`, and having checked `__c != std::basic_streambuf<CharT>::traits_type::eof()` (substituting typedefs for clarity), the line `str_.push_back(__c);` is safe according to humans, but truncates according to compilers. `str_.push_back(static_cast<CharT>(__c));` avoids that problem. Fixes D27538. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289105 91177308-0d34-0410-b5e6-96231b3b80d8