[libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".
Fixes D34534. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -40,7 +40,7 @@ protected:
|
|||||||
if (__c != base::traits_type::eof())
|
if (__c != base::traits_type::eof())
|
||||||
{
|
{
|
||||||
int n = str_.size();
|
int n = str_.size();
|
||||||
str_.push_back(__c);
|
str_.push_back(static_cast<CharT>(__c));
|
||||||
str_.resize(str_.capacity());
|
str_.resize(str_.capacity());
|
||||||
base::setp(const_cast<CharT*>(str_.data()),
|
base::setp(const_cast<CharT*>(str_.data()),
|
||||||
const_cast<CharT*>(str_.data() + str_.size()));
|
const_cast<CharT*>(str_.data() + str_.size()));
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ protected:
|
|||||||
if (__c != base::traits_type::eof())
|
if (__c != base::traits_type::eof())
|
||||||
{
|
{
|
||||||
int n = str_.size();
|
int n = str_.size();
|
||||||
str_.push_back(__c);
|
str_.push_back(static_cast<CharT>(__c));
|
||||||
str_.resize(str_.capacity());
|
str_.resize(str_.capacity());
|
||||||
base::setp(const_cast<CharT*>(str_.data()),
|
base::setp(const_cast<CharT*>(str_.data()),
|
||||||
const_cast<CharT*>(str_.data() + str_.size()));
|
const_cast<CharT*>(str_.data() + str_.size()));
|
||||||
|
|||||||
Reference in New Issue
Block a user