diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-08 21:37:47 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-08 21:37:47 +0000 |
commit | c53fd92b0f059882ee415b8371d3f0cf8478aa3a (patch) | |
tree | 971fab60ba1db3573eeda109f3d8c06f4b8c4983 /test/std/utilities | |
parent | 22e3b2af5014c449b5546aca8f95bfd13adf7b01 (diff) | |
download | external_libcxx-c53fd92b0f059882ee415b8371d3f0cf8478aa3a.tar.gz external_libcxx-c53fd92b0f059882ee415b8371d3f0cf8478aa3a.tar.bz2 external_libcxx-c53fd92b0f059882ee415b8371d3f0cf8478aa3a.zip |
[libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 1/7.
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
Diffstat (limited to 'test/std/utilities')
0 files changed, 0 insertions, 0 deletions