clean up some qualifier casting
This cleans up the `-Wqual-cast` warnings from gcc 6 when building
libc++. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290789 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__std_stream b/include/__std_stream
index f867cd2..fb5a346 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -297,7 +297,7 @@
return traits_type::eof();
if (__r == codecvt_base::partial)
{
- pbase = (char_type*)__e;
+ pbase = const_cast<char_type*>(__e);
}
}
else
diff --git a/include/type_traits b/include/type_traits
index f6a016d..e2b5377 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -443,7 +443,8 @@
_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