[libcxx] r308532 - [libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 19 15:02:22 PDT 2017
Author: stl_msft
Date: Wed Jul 19 15:02:22 2017
New Revision: 308532
URL: http://llvm.org/viewvc/llvm-project?rev=308532&view=rev
Log:
[libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".
Fixes D34534.
Modified:
libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
Modified: libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp?rev=308532&r1=308531&r2=308532&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp Wed Jul 19 15:02:22 2017
@@ -40,7 +40,7 @@ protected:
if (__c != base::traits_type::eof())
{
int n = str_.size();
- str_.push_back(__c);
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp?rev=308532&r1=308531&r2=308532&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp Wed Jul 19 15:02:22 2017
@@ -46,7 +46,7 @@ protected:
if (__c != base::traits_type::eof())
{
int n = str_.size();
- str_.push_back(__c);
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
More information about the cfe-commits
mailing list