diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -531,7 +531,7 @@ #define _LIBCPP_NORETURN __attribute__((noreturn)) -#if !__EXCEPTIONS +#if !defined(__EXCEPTIONS) # define _LIBCPP_NO_EXCEPTIONS #endif @@ -1023,7 +1023,8 @@ #if defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_COMPILER_GCC) # define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \ _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") + _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") # define _LIBCPP_SUPPRESS_DEPRECATED_POP \ _Pragma("GCC diagnostic pop") #else diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -741,9 +741,9 @@ private: #if _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY - __hash_const_local_iterator(__next_pointer __node, size_t __bucket, + __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket, size_t __bucket_count, const void* __c) _NOEXCEPT - : __node_(__node), + : __node_(__node_ptr), __bucket_(__bucket), __bucket_count_(__bucket_count) { @@ -753,9 +753,9 @@ } #else _LIBCPP_INLINE_VISIBILITY - __hash_const_local_iterator(__next_pointer __node, size_t __bucket, + __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket, size_t __bucket_count) _NOEXCEPT - : __node_(__node), + : __node_(__node_ptr), __bucket_(__bucket), __bucket_count_(__bucket_count) { diff --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h --- a/libcxx/include/__ranges/transform_view.h +++ b/libcxx/include/__ranges/transform_view.h @@ -360,7 +360,7 @@ __sentinel() = default; _LIBCPP_HIDE_FROM_ABI - constexpr explicit __sentinel(sentinel_t<_Base> __end_) : __end_(__end_) {} + constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {} // Note: `__i` should always be `__sentinel`, but directly using // `__sentinel` is ill-formed when `_Const` is false diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -107,7 +107,6 @@ template class __barrier_base { - ptrdiff_t __expected; unique_ptr<__barrier_algorithm_base, void (*)(__barrier_algorithm_base*)> __base; @@ -146,7 +145,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(arrival_token&& __old_phase) const { - auto const __test_fn = [=]() -> bool { + auto const __test_fn = [this, __old_phase]() -> bool { return __phase.load(memory_order_acquire) != __old_phase; }; __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy()); diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -612,13 +612,13 @@ return __subject_seq_combinator( __first, __last, __value, - [](const char* __p, const char* __last, _Tp& __value, + [](const char* __p, const char* __lastx, _Tp& __value, int __base) -> from_chars_result { using __tl = numeric_limits<_Tp>; auto __digits = __tl::digits / log2f(float(__base)); _Tp __a = __in_pattern(*__p++, __base).__val, __b = 0; - for (int __i = 1; __p != __last; ++__i, ++__p) + for (int __i = 1; __p != __lastx; ++__i, ++__p) { if (auto __c = __in_pattern(*__p, __base)) { @@ -636,7 +636,7 @@ break; } - if (__p == __last || !__in_pattern(*__p, __base)) + if (__p == __lastx || !__in_pattern(*__p, __base)) { if (__tl::max() - __a >= __b) { diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -621,7 +621,7 @@ if (__t == 1) return __b; const _Fp __x = __a + __t * (__b - __a); - if (__t > 1 == __b > __a) + if ((__t > 1) == (__b > __a)) return __b < __x ? __x : __b; else return __x < __b ? __x : __b; diff --git a/libcxx/include/compare b/libcxx/include/compare --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -449,7 +449,7 @@ return _StrongOrd; } -template +template constexpr auto __get_comp_type() { using _CCC = _ClassifyCompCategory; constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...}; @@ -463,7 +463,7 @@ else if constexpr (_Cat == _StrongOrd) return strong_ordering::equivalent; else - static_assert(_Cat != _Cat, "unhandled case"); + static_assert(_False, "unhandled case"); } } // namespace __comp_detail diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -796,7 +796,7 @@ ptrdiff_t _Np = __end1 - __begin1; __end2 -= _Np; if (_Np > 0) - _VSTD::memcpy(__end2, __begin1, _Np * sizeof(_Tp)); + _VSTD::memcpy(static_cast(__end2), static_cast(__begin1), _Np * sizeof(_Tp)); } struct __destruct_n diff --git a/libcxx/include/random b/libcxx/include/random --- a/libcxx/include/random +++ b/libcxx/include/random @@ -1731,7 +1731,7 @@ template (_Mp-__c)/__a), - bool _OverflowOK = ((__m|__m-1) > __m), // m = 2^n + bool _OverflowOK = ((__m | (__m-1)) > __m), // m = 2^n bool _SchrageOK = (__a != 0 && __m != 0 && __m % __a <= __m / __a)> // r <= q struct __lce_alg_picker { diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -2003,14 +2003,14 @@ { typedef __owns_one_state<_CharT> base; - bool __multiline; + bool __multiline_; public: typedef _VSTD::__state<_CharT> __state; _LIBCPP_INLINE_VISIBILITY __l_anchor_multiline(bool __multiline, __node<_CharT>* __s) - : base(__s), __multiline(__multiline) {} + : base(__s), __multiline_(__multiline) {} virtual void __exec(__state&) const; }; @@ -2025,7 +2025,7 @@ __s.__do_ = __state::__accept_but_not_consume; __s.__node_ = this->first(); } - else if (__multiline && + else if (__multiline_ && !__s.__at_first_ && __is_eol(*_VSTD::prev(__s.__current_))) { @@ -4574,7 +4574,7 @@ if (__hd == -1) __throw_regex_error(); __sum = 16 * __sum + static_cast(__hd); - // drop through + // fallthrough case 'x': ++__first; if (__first == __last) diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore --- a/libcxx/include/semaphore +++ b/libcxx/include/semaphore @@ -98,7 +98,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void acquire() { - auto const __test_fn = [=]() -> bool { + auto const __test_fn = [this]() -> bool { auto __old = __a.load(memory_order_relaxed); return (__old != 0) && __a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed); }; @@ -108,7 +108,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY bool try_acquire_for(chrono::duration const& __rel_time) { - auto const __test_fn = [=]() -> bool { + auto const __test_fn = [this]() -> bool { auto __old = __a.load(memory_order_acquire); while(1) { if (__old == 0) diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -2438,7 +2438,7 @@ void __vdeallocate() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static size_type __align_it(size_type __new_size) _NOEXCEPT - {return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);} + {return __new_size + ((__bits_per_word-1) & ~((size_type)__bits_per_word-1));} _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x); template