Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-06-14 20:00:36 +00:00
parent 899f113f6c
commit ff5f9b28ba
5 changed files with 15 additions and 13 deletions

View File

@@ -704,7 +704,7 @@ function<_Rp()>::target()
{
if (__f_ == 0)
return (_Tp*)0;
return (_Tp*)__f_->target(typeid(_Tp));
return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
}
template<class _Rp>
@@ -980,7 +980,7 @@ function<_Rp(_A0)>::target()
{
if (__f_ == 0)
return (_Tp*)0;
return (_Tp*)__f_->target(typeid(_Tp));
return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
}
template<class _Rp, class _A0>
@@ -1256,7 +1256,7 @@ function<_Rp(_A0, _A1)>::target()
{
if (__f_ == 0)
return (_Tp*)0;
return (_Tp*)__f_->target(typeid(_Tp));
return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
}
template<class _Rp, class _A0, class _A1>
@@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1, _A2)>::target()
{
if (__f_ == 0)
return (_Tp*)0;
return (_Tp*)__f_->target(typeid(_Tp));
return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
}
template<class _Rp, class _A0, class _A1, class _A2>