diff --git a/libcxx/include/__atomic/is_always_lock_free.h b/libcxx/include/__atomic/is_always_lock_free.h --- a/libcxx/include/__atomic/is_always_lock_free.h +++ b/libcxx/include/__atomic/is_always_lock_free.h @@ -20,7 +20,7 @@ template struct __libcpp_is_always_lock_free { // __atomic_always_lock_free is available in all Standard modes - static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0); + static const bool __value = __atomic_always_lock_free(sizeof(_Tp), nullptr); }; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -547,8 +547,8 @@ #if _LIBCPP_STD_VER >= 17 inline _LIBCPP_INLINE_VISIBILITY float hypot( float __x, float __y, float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } -inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } -inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } +inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrtf(__x*__x + __y*__y + __z*__z); } +inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrtl(__x*__x + __y*__y + __z*__z); } template inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -874,7 +874,7 @@ } public: - _LIBCPP_TEMPLATE_DATA_VIS static const size_type npos = -1; + _LIBCPP_TEMPLATE_DATA_VIS static const size_type npos = numeric_limits::max(); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value) diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -286,7 +286,7 @@ using reverse_iterator = const_reverse_iterator; using size_type = size_t; using difference_type = ptrdiff_t; - static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1); + static _LIBCPP_CONSTEXPR const size_type npos = numeric_limits::max() ; // size_type(-1); static_assert((!is_array::value), "Character type of basic_string_view must not be an array"); static_assert(( is_standard_layout::value), "Character type of basic_string_view must be standard-layout"); diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -342,7 +342,7 @@ using type = __type_pack_element<_Ip, _Types...>; }; -inline constexpr size_t variant_npos = static_cast(-1); +inline constexpr size_t variant_npos = numeric_limits::max(); _LIBCPP_HIDE_FROM_ABI constexpr int __choose_index_type(unsigned int __num_elem) { if (__num_elem < numeric_limits::max()) diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -21,6 +21,10 @@ "-Wextra", "-Wshadow", "-Wundef", + "-Wimplicit-float-conversion", + "-Wmacro-redefined", + "-Wsign-conversion", + "-Wzero-as-null-pointer-constant", "-Wunused-template", "-Wno-unused-command-line-argument", "-Wno-attributes",