[libcxx] r290789 - clean up some qualifier casting
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 31 10:13:34 PST 2016
Author: compnerd
Date: Sat Dec 31 12:13:34 2016
New Revision: 290789
URL: http://llvm.org/viewvc/llvm-project?rev=290789&view=rev
Log:
clean up some qualifier casting
This cleans up the `-Wqual-cast` warnings from gcc 6 when building
libc++. NFC.
Modified:
libcxx/trunk/include/__std_stream
libcxx/trunk/include/type_traits
Modified: libcxx/trunk/include/__std_stream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__std_stream?rev=290789&r1=290788&r2=290789&view=diff
==============================================================================
--- libcxx/trunk/include/__std_stream (original)
+++ libcxx/trunk/include/__std_stream Sat Dec 31 12:13:34 2016
@@ -297,7 +297,7 @@ __stdoutbuf<_CharT>::overflow(int_type _
return traits_type::eof();
if (__r == codecvt_base::partial)
{
- pbase = (char_type*)__e;
+ pbase = const_cast<char_type*>(__e);
}
}
else
Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=290789&r1=290788&r2=290789&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Sat Dec 31 12:13:34 2016
@@ -443,7 +443,8 @@ inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VIS
_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
More information about the cfe-commits
mailing list