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 | d7dc18e26dd7890ede5690d31a5b608ae43ea1ce (patch) | |
tree | 3f6bd64868b7478114401281d4d0bdf10ad18864 /libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp | |
parent | 8d433d71f5407d6f3c19d6609f2f2f016cc17bb9 (diff) | |
download | bcm5719-llvm-d7dc18e26dd7890ede5690d31a5b608ae43ea1ce.tar.gz bcm5719-llvm-d7dc18e26dd7890ede5690d31a5b608ae43ea1ce.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.
llvm-svn: 289105
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp')
0 files changed, 0 insertions, 0 deletions