clean up some qualifier casting

This cleans up the `-Wqual-cast` warnings from gcc 6 when building
libc++.  NFC.

llvm-svn: 290789
This commit is contained in:
Saleem Abdulrasool 2016-12-31 18:13:34 +00:00
parent 94865f9ab0
commit 2177f3ce5f
2 changed files with 3 additions and 2 deletions

View File

@ -297,7 +297,7 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
return traits_type::eof();
if (__r == codecvt_base::partial)
{
pbase = (char_type*)__e;
pbase = const_cast<char_type*>(__e);
}
}
else

View File

@ -443,7 +443,8 @@ inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
_Tp*
addressof(_Tp& __x) _NOEXCEPT
{
return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
return reinterpret_cast<_Tp *>(
const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
}
#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF