diff --git a/stl/inc/algorithm b/stl/inc/algorithm index cb6147d51fa..563c1913209 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -887,12 +887,10 @@ _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _Fw #ifdef __cpp_lib_concepts namespace ranges { - // clang-format off template concept _Bidi_common = is_same_v<_It, _Se> && bidirectional_iterator<_It>; template concept _Bidi_common_range = common_range<_Rng> && bidirectional_iterator>; - // clang-format on class _Is_permutation_fn : private _Not_quite_object { public: @@ -3913,16 +3911,14 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// clang-format off #ifdef __cpp_lib_concepts template concept _Can_reread_dest = forward_iterator<_OutIt> && same_as, iter_value_t<_OutIt>>; #else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template -_INLINE_VAR constexpr bool _Can_reread_dest = - _Is_fwd_iter_v<_OutIt> && is_same_v<_Iter_value_t<_InIt>, _Iter_value_t<_OutIt>>; +_INLINE_VAR constexpr bool _Can_reread_dest = _Is_fwd_iter_v<_OutIt> // + && is_same_v<_Iter_value_t<_InIt>, _Iter_value_t<_OutIt>>; #endif // __cpp_lib_concepts -// clang-format on template _CONSTEXPR20 _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { @@ -4010,15 +4006,14 @@ namespace ranges { template using unique_copy_result = in_out_result<_In, _Out>; - // clang-format off template concept _Is_input_with_value_type = input_iterator<_It> && same_as, _Ty>; template - concept _Can_reread_or_store = forward_iterator<_It> - || _Is_input_with_value_type<_Out, iter_value_t<_It>> - || indirectly_copyable_storable<_It, _Out>; - // clang-format on + concept _Can_reread_or_store = forward_iterator<_It> // + || _Is_input_with_value_type<_Out, iter_value_t<_It>> // + || indirectly_copyable_storable<_It, _Out>; + class _Unique_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -7077,7 +7072,7 @@ namespace ranges { "ranges::inplace_merge requires the range [first, middle) to be sorted"); _STL_VERIFY(_RANGES _Is_sorted_until_unchecked(_Mid, _Last, _Pred, _Proj) == _Last, "ranges::inplace_merge requires the range [middle, last) to be sorted"); -#endif //_ITERATOR_DEBUG_LEVEL == 2 +#endif // _ITERATOR_DEBUG_LEVEL == 2 // Find first element in [_First, _Mid) that is greater than *_Mid while (!_STD invoke(_Pred, _STD invoke(_Proj, *_Mid), _STD invoke(_Proj, *_First))) { @@ -9412,13 +9407,11 @@ _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - // clang-format off template concept _Prefer_iterator_copies = // When we have a choice, should we copy iterators or copy elements? - // pre: input_iterator<_It> + // pre: input_iterator<_It> sizeof(_It) <= 2 * sizeof(iter_value_t<_It>) && (is_trivially_copyable_v<_It> || !is_trivially_copyable_v>); - // clang-format on class _Max_fn : private _Not_quite_object { public: diff --git a/stl/inc/atomic b/stl/inc/atomic index 4415260018c..3f15cb007c5 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2137,7 +2137,7 @@ using _Choose_atomic_base_t = typename _Select>::temp #else // ^^^ _HAS_CXX20 // !_HAS_CXX20 vvv template using _Choose_atomic_base_t = _Choose_atomic_base2_t<_TVal, _Ty>; -#endif //_HAS_CXX20 +#endif // _HAS_CXX20 template struct atomic : _Choose_atomic_base_t<_Ty> { // atomic value @@ -2145,12 +2145,10 @@ private: using _Base = _Choose_atomic_base_t<_Ty>; public: - // clang-format off - static_assert(is_trivially_copyable_v<_Ty> && is_copy_constructible_v<_Ty> && is_move_constructible_v<_Ty> - && is_copy_assignable_v<_Ty> && is_move_assignable_v<_Ty>, + static_assert(is_trivially_copyable_v<_Ty> && is_copy_constructible_v<_Ty> && is_move_constructible_v<_Ty> // + && is_copy_assignable_v<_Ty> && is_move_assignable_v<_Ty>, "atomic requires T to be trivially copyable, copy constructible, move constructible, copy assignable, " "and move assignable."); - // clang-format on using value_type = _Ty; diff --git a/stl/inc/chrono b/stl/inc/chrono index 089df241659..e3f887fa27e 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -2171,13 +2171,11 @@ namespace chrono { duration, ratio<1, _Pow10(fractional_width)>>; constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {} - // clang-format off constexpr explicit hh_mm_ss(_Duration _Dur) - : _Is_neg{_Dur < _Duration::zero()}, + : _Is_neg{_Dur < _Duration::zero()}, // _Hours{_CHRONO duration_cast<_CHRONO hours>(_CHRONO abs(_Dur))}, _Mins{_CHRONO duration_cast<_CHRONO minutes>(_CHRONO abs(_Dur) - hours())}, _Secs{_CHRONO duration_cast<_CHRONO seconds>(_CHRONO abs(_Dur) - hours() - minutes())} { - // clang-format on if constexpr (treat_as_floating_point_v) { _Sub_secs = _CHRONO abs(_Dur) - hours() - minutes() - seconds(); } else { @@ -4012,10 +4010,8 @@ namespace chrono { // std::days can't represent std::seconds, and duration::max() is ~9.2 seconds. constexpr auto _Max_tick = static_cast((numeric_limits>::max) ()); - // clang-format off - return ratio_less_equal_v<_Period1, _Period2> + return ratio_less_equal_v<_Period1, _Period2> // && ratio_greater_equal_v, ratio_divide, _Period1>>; - // clang-format on } else if (is_floating_point_v<_Rep1>) { // With the smallest possible _Period1, ratio<1,INTMAX_MAX>, one day has a tick count of // 86,400*INTMAX_MAX ~= 7.97e23. This is representable by float and double, so they can always represent @@ -5222,12 +5218,10 @@ concept _Chrono_parse_spec_callbacks = _Parse_align_callbacks<_Ty, _CharT> }; // clang-format on -// clang-format off template concept _Has_ok = requires(_Ty _At) { { _At.ok() } -> same_as; }; -// clang-format on // A chrono spec is either a type (with an optional modifier), OR a literal character, never both. template @@ -6140,12 +6134,10 @@ namespace chrono { template static void _Validate_specifiers(const _Chrono_spec<_CharT>& _Spec, const _Ty& _Val) { - // clang-format off - if constexpr (_Is_specialization_v<_Ty, duration> || is_same_v<_Ty, sys_info> - || _Is_specialization_v<_Ty, time_point> || _Is_specialization_v<_Ty, _Local_time_format_t>) { + if constexpr (_Is_specialization_v<_Ty, duration> || is_same_v<_Ty, sys_info> // + || _Is_specialization_v<_Ty, time_point> || _Is_specialization_v<_Ty, _Local_time_format_t>) { return; } - // clang-format on if constexpr (_Is_specialization_v<_Ty, hh_mm_ss>) { if (_Spec._Type == 'H' && _Val.hours() >= hours{24}) { diff --git a/stl/inc/compare b/stl/inc/compare index 1f990673301..0604144a042 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -653,13 +653,11 @@ inline namespace _Cpos { inline constexpr _Partial_order::_Cpo partial_order; } -// clang-format off template concept _Can_fallback_eq_lt = requires(_Ty1& _Left, _Ty2& _Right) { { _Left == _Right } -> _Implicitly_convertible_to; - { _Left < _Right } -> _Implicitly_convertible_to; + { _Left < _Right } -> _Implicitly_convertible_to; }; -// clang-format on namespace _Compare_strong_order_fallback { template @@ -775,14 +773,12 @@ namespace _Compare_partial_order_fallback { _STD partial_order(_Left, _Right); }; - // clang-format off template concept _Can_fallback_eq_lt_twice = requires(_Ty1& _Left, _Ty2& _Right) { - { _Left == _Right } -> _Implicitly_convertible_to; - { _Left < _Right } -> _Implicitly_convertible_to; - { _Right < _Left } -> _Implicitly_convertible_to; + { _Left == _Right } -> _Implicitly_convertible_to; + { _Left < _Right } -> _Implicitly_convertible_to; + { _Right < _Left } -> _Implicitly_convertible_to; }; - // clang-format on class _Cpo { private: diff --git a/stl/inc/cvt/euc_0208 b/stl/inc/cvt/euc_0208 index c669ce95555..358a84aa11e 100644 --- a/stl/inc/cvt/euc_0208 +++ b/stl/inc/cvt/euc_0208 @@ -154,8 +154,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/jis_0208 b/stl/inc/cvt/jis_0208 index 7e0489d7a29..df631bb82d4 100644 --- a/stl/inc/cvt/jis_0208 +++ b/stl/inc/cvt/jis_0208 @@ -210,8 +210,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/one_one b/stl/inc/cvt/one_one index f761392fead..13b0e47eb0c 100644 --- a/stl/inc/cvt/one_one +++ b/stl/inc/cvt/one_one @@ -185,8 +185,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/sjis_0208 b/stl/inc/cvt/sjis_0208 index e06af3cb614..79e85bf5a00 100644 --- a/stl/inc/cvt/sjis_0208 +++ b/stl/inc/cvt/sjis_0208 @@ -142,8 +142,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/utf16 b/stl/inc/cvt/utf16 index 1fb750a894c..b6105b12e3e 100644 --- a/stl/inc/cvt/utf16 +++ b/stl/inc/cvt/utf16 @@ -214,8 +214,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/utf8 b/stl/inc/cvt/utf8 index 07ee329af8f..76a61f773bb 100644 --- a/stl/inc/cvt/utf8 +++ b/stl/inc/cvt/utf8 @@ -193,8 +193,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/utf8_utf16 b/stl/inc/cvt/utf8_utf16 index bc652ebed44..4c4008cc46e 100644 --- a/stl/inc/cvt/utf8_utf16 +++ b/stl/inc/cvt/utf8_utf16 @@ -251,8 +251,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/wbuffer b/stl/inc/cvt/wbuffer index cea11d042be..264220f1208 100644 --- a/stl/inc/cvt/wbuffer +++ b/stl/inc/cvt/wbuffer @@ -78,8 +78,9 @@ namespace stdext { char* _Buf = &_Str[0]; char* _Dest; - switch ( - _Pcvt->unshift(_State, _Buf, _Buf + _Str.size(), _Dest)) { // test result of homing conversion + + // test result of homing conversion + switch (_Pcvt->unshift(_State, _Buf, _Buf + _Str.size(), _Dest)) { case _Codecvt::ok: _Status = _Unused; // homed successfully @@ -143,8 +144,9 @@ namespace stdext { char* _Buf = &_Str[0]; const _Elem* _Src; char* _Dest; - switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Buf, _Buf + _Str.size(), - _Dest)) { // test result of converting one element + + // test result of converting one element + switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Buf, _Buf + _Str.size(), _Dest)) { case _Codecvt::partial: case _Codecvt::ok: { // converted something, try to put it out @@ -274,8 +276,8 @@ namespace stdext { } } - switch (_Pcvt->in(_State, _Buf, _Buf + _Str.size(), _Src, &_Ch, &_Ch + 1, - _Dest)) { // test result of converting one element + // test result of converting one element + switch (_Pcvt->in(_State, _Buf, _Buf + _Str.size(), _Src, &_Ch, &_Ch + 1, _Dest)) { case _Codecvt::partial: case _Codecvt::ok: _Str.erase(0, static_cast(_Src - _Buf)); // discard any used input diff --git a/stl/inc/cvt/wstring b/stl/inc/cvt/wstring index 96b539b4eb1..af733694999 100644 --- a/stl/inc/cvt/wstring +++ b/stl/inc/cvt/wstring @@ -105,8 +105,8 @@ namespace stdext { _Elem* _Dest = &_Wbuf[0]; _Elem* _Dnext; - switch (_Pcvt->in(_State, _First, _Last, _First, _Dest, _Dest + _Wbuf.size(), - _Dnext)) { // test result of converting one or more bytes + // test result of converting one or more bytes + switch (_Pcvt->in(_State, _First, _Last, _First, _Dest, _Dest + _Wbuf.size(), _Dnext)) { case _Codecvt::partial: case _Codecvt::ok: if (_Dest < _Dnext) { @@ -173,8 +173,8 @@ namespace stdext { char* _Dest = &_Bbuf[0]; char* _Dnext; - switch (_Pcvt->out(_State, _First, _Last, _First, _Dest, _Dest + _Bbuf.size(), - _Dnext)) { // test result of converting one or more wide chars + // test result of converting one or more wide chars + switch (_Pcvt->out(_State, _First, _Last, _First, _Dest, _Dest + _Bbuf.size(), _Dnext)) { case _Codecvt::partial: case _Codecvt::ok: if (_Dest < _Dnext) { diff --git a/stl/inc/cvt/xjis b/stl/inc/cvt/xjis index ffb37e27b64..3a99f38ea49 100644 --- a/stl/inc/cvt/xjis +++ b/stl/inc/cvt/xjis @@ -274,8 +274,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/cvt/xtwo_byte b/stl/inc/cvt/xtwo_byte index 21937196e98..a8021115155 100644 --- a/stl/inc/cvt/xtwo_byte +++ b/stl/inc/cvt/xtwo_byte @@ -162,8 +162,8 @@ namespace stdext { _Elem* _Mid2; _Elem _Ch; - switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, - _Mid2)) { // test result of single wide-char conversion + // test result of single wide-char conversion + switch (do_in(_Mystate, _First1, _Last1, _Mid1, &_Ch, &_Ch + 1, _Mid2)) { case _Mybase::noconv: return static_cast(_Wchars + (_Last1 - _First1)); diff --git a/stl/inc/fstream b/stl/inc/fstream index 1120343badc..9c3c38f7c3d 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -436,8 +436,9 @@ protected: const _Elem _Ch = _Traits::to_char_type(_Meta); const _Elem* _Src; char* _Dest; - switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Str, _Str + _Codecvt_temp_buf, - _Dest)) { // test result of converting one element + + // test result of converting one element + switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Str, _Str + _Codecvt_temp_buf, _Dest)) { case codecvt_base::partial: case codecvt_base::ok: { // converted something, try to put it out @@ -526,8 +527,9 @@ protected: _Elem _Ch; _Elem* _Dest; - switch (_Pcvt->in(_State, _Str.data(), _Str.data() + _Str.size(), _Src, &_Ch, &_Ch + 1, - _Dest)) { // test result of converting one element + + // test result of converting one element + switch (_Pcvt->in(_State, _Str.data(), _Str.data() + _Str.size(), _Src, &_Ch, &_Ch + 1, _Dest)) { case codecvt_base::partial: case codecvt_base::ok: if (_Dest != &_Ch) { // got an element, put back excess and deliver it diff --git a/stl/inc/memory b/stl/inc/memory index 88726d5ee67..7f2ca6eb710 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -4056,12 +4056,12 @@ public: template struct _Pointer_of_helper {}; -// clang-format off template <_Has_member_pointer _Ty> struct _Pointer_of_helper<_Ty> { using type = typename _Ty::pointer; }; +// clang-format off template <_Has_member_element_type _Ty> requires (!_Has_member_pointer<_Ty>) struct _Pointer_of_helper<_Ty> { diff --git a/stl/inc/ranges b/stl/inc/ranges index d635ae27fa6..73e41470504 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -857,6 +857,7 @@ namespace ranges { _Ty(__j - __n); { __j - __j } -> convertible_to<_Iota_diff_t<_Ty>>; }; + // clang-format on template struct _Ioterator_category_base { @@ -870,6 +871,7 @@ namespace ranges { _NODISCARD auto operator<=>(const _Ioterator_category_base&) const = default; }; + // clang-format off template requires copyable<_Wi> struct _Ioterator : _Ioterator_category_base<_Wi> { @@ -923,12 +925,13 @@ namespace ranges { } #if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1347136 - private : - + // clang-format off + private: template static constexpr bool _Nothrow_plus_equal = noexcept(_STD declval<_Left&>() += _STD declval()); template <_Integer_like _Left, class _Right> static constexpr bool _Nothrow_plus_equal<_Left, _Right> = true; + // clang-format on template static constexpr bool _Nothrow_minus_equal = noexcept(_STD declval<_Left&>() -= _STD declval()); @@ -1391,10 +1394,9 @@ namespace ranges { template struct _Category_base {}; - // clang-format off + template struct _Category_base<_View> { - // clang-format on using iterator_category = conditional_t>, bidirectional_iterator_tag>, bidirectional_iterator_tag, @@ -1676,10 +1678,9 @@ namespace ranges { template struct _Category_base {}; - // clang-format off + template struct _Category_base<_Base> { - // clang-format on using iterator_category = conditional_t>>, conditional_t>, contiguous_iterator_tag>, @@ -2308,10 +2309,8 @@ namespace ranges { template inline constexpr bool _Is_subrange> = true; - // clang-format off template concept _Random_sized_range = random_access_range<_Rng> && sized_range<_Rng>; - // clang-format on class _Take_fn { private: @@ -2395,11 +2394,9 @@ namespace ranges { }; public: - // clang-format off template - _NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const noexcept( - _Choice<_Rng>._No_throw) { - // clang-format on + _NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const + noexcept(_Choice<_Rng>._No_throw) { constexpr _St _Strat = _Choice<_Rng>._Strategy; if constexpr (_Strat == _St::_Empty) { @@ -2826,11 +2823,9 @@ namespace ranges { }; public: - // clang-format off template - _NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const noexcept( - _Choice<_Rng>._No_throw) { - // clang-format on + _NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const + noexcept(_Choice<_Rng>._No_throw) { constexpr _St _Strat = _Choice<_Rng>._Strategy; if constexpr (_Strat == _St::_Empty) { @@ -3296,11 +3291,9 @@ namespace ranges { return _Iterator{*this, _RANGES begin(_Range)}; } - // clang-format off _NODISCARD constexpr auto end() { - if constexpr (forward_range<_Vw> && is_reference_v<_InnerRng> - && forward_range<_InnerRng> && common_range<_Vw> && common_range<_InnerRng>) { - // clang-format on + if constexpr (forward_range<_Vw> && is_reference_v<_InnerRng> // + && forward_range<_InnerRng> && common_range<_Vw> && common_range<_InnerRng>) { return _Iterator<_Simple_view<_Vw>>{*this, _RANGES end(_Range)}; } else { return _Sentinel<_Simple_view<_Vw>>{*this}; diff --git a/stl/inc/span b/stl/inc/span index b68c5c5d621..c75d38f32f2 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -292,15 +292,13 @@ template struct _Has_container_interface<_Rng, void_t())), decltype(_STD size(_STD declval<_Rng&>()))>> : true_type {}; -// clang-format off template -inline constexpr bool _Is_span_compatible_range = conjunction_v< - negation>, - negation<_Is_span>>, - negation<_Is_std_array>>, - _Has_container_interface<_Rng>, +inline constexpr bool _Is_span_compatible_range = conjunction_v< // + negation>, // + negation<_Is_span>>, // + negation<_Is_std_array>>, // + _Has_container_interface<_Rng>, // _Is_span_convertible_range<_Rng, _Ty>>; -// clang-format on #endif // !__cpp_lib_concepts diff --git a/stl/inc/stdatomic.h b/stl/inc/stdatomic.h index 462759021bf..023a34e26f2 100644 --- a/stl/inc/stdatomic.h +++ b/stl/inc/stdatomic.h @@ -31,7 +31,6 @@ using _Std_atomic = _STD atomic<_Ty>; #define _Atomic(T) _Std_atomic -// clang-format off using _STD memory_order; using _STD memory_order_relaxed; using _STD memory_order_consume; @@ -119,7 +118,6 @@ using _STD atomic_flag_clear_explicit; using _STD atomic_thread_fence; using _STD atomic_signal_fence; -// clang-format on #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/xlocbuf b/stl/inc/xlocbuf index 6e666135f07..80ae66da204 100644 --- a/stl/inc/xlocbuf +++ b/stl/inc/xlocbuf @@ -128,8 +128,9 @@ protected: char* _Buf = &_Str[0]; const _Elem* _Src; char* _Dest; - switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Buf, _Buf + _Str.size(), - _Dest)) { // test result of converting one element + + // test result of converting one element + switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Buf, _Buf + _Str.size(), _Dest)) { case _Codecvt::partial: case _Codecvt::ok: { // converted something, try to put it out @@ -221,14 +222,12 @@ protected: #pragma warning(pop) pos_type seekoff(off_type, ios_base::seekdir, - ios_base::openmode = static_cast( - ios_base::in | ios_base::out)) override { // change position by _Off + ios_base::openmode = static_cast(ios_base::in | ios_base::out)) override { return pos_type(-1); // always fail } - pos_type seekpos(pos_type, - ios_base::openmode = static_cast( - ios_base::in | ios_base::out)) override { // change position to _Pos + pos_type seekpos( + pos_type, ios_base::openmode = static_cast(ios_base::in | ios_base::out)) override { return pos_type(-1); // always fail } @@ -258,8 +257,8 @@ private: } } - switch (_Pcvt->in(_State, _Buf, _Buf + _Str.size(), _Src, &_Ch, &_Ch + 1, - _Dest)) { // test result of converting one element + // test result of converting one element + switch (_Pcvt->in(_State, _Buf, _Buf + _Str.size(), _Src, &_Ch, &_Ch + 1, _Dest)) { case _Codecvt::partial: case _Codecvt::ok: _Str.erase(0, static_cast(_Src - _Buf)); // discard any used input @@ -379,8 +378,8 @@ public: _Elem* _Dest = &_Wbuf[0]; _Elem* _Dnext; - switch (_Pcvt->in(_State, _First, _Last, _First, _Dest, _Dest + _Wbuf.size(), - _Dnext)) { // test result of converting one or more bytes + // test result of converting one or more bytes + switch (_Pcvt->in(_State, _First, _Last, _First, _Dest, _Dest + _Wbuf.size(), _Dnext)) { case _Codecvt::partial: case _Codecvt::ok: if (_Dest < _Dnext) { @@ -447,8 +446,8 @@ public: char* _Dest = &_Bbuf[0]; char* _Dnext; - switch (_Pcvt->out(_State, _First, _Last, _First, _Dest, _Dest + _Bbuf.size(), - _Dnext)) { // test result of converting one or more wide chars + // test result of converting one or more wide chars + switch (_Pcvt->out(_State, _First, _Last, _First, _Dest, _Dest + _Bbuf.size(), _Dnext)) { case _Codecvt::partial: case _Codecvt::ok: if (_Dest < _Dnext) { diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 29f2c2afb3a..bc3feb2109b 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -1495,29 +1495,27 @@ _CONSTEXPR20 _NoThrowFwdIt _Uninitialized_move_unchecked(_InIt _First, const _In #ifdef __cpp_lib_concepts namespace ranges { - // clang-format off template - concept _No_throw_input_iterator = input_iterator<_It> - && is_lvalue_reference_v> + concept _No_throw_input_iterator = input_iterator<_It> // + && is_lvalue_reference_v> // && same_as>, iter_value_t<_It>>; template concept _No_throw_sentinel_for = sentinel_for<_Se, _It>; template - concept _No_throw_forward_iterator = _No_throw_input_iterator<_It> - && forward_iterator<_It> + concept _No_throw_forward_iterator = _No_throw_input_iterator<_It> // + && forward_iterator<_It> // && _No_throw_sentinel_for<_It, _It>; template - concept _No_throw_input_range = range<_Rng> - && _No_throw_input_iterator> + concept _No_throw_input_range = range<_Rng> // + && _No_throw_input_iterator> // && _No_throw_sentinel_for, iterator_t<_Rng>>; template - concept _No_throw_forward_range = _No_throw_input_range<_Rng> + concept _No_throw_forward_range = _No_throw_input_range<_Rng> // && _No_throw_forward_iterator>; - // clang-format on template in_out_result<_InIt, _OutIt> _Copy_memcpy_count(_InIt _IFirst, _OutIt _OFirst, const size_t _Count) noexcept { @@ -1602,34 +1600,34 @@ namespace ranges { // clang-format off template _Se, _No_throw_forward_iterator _Out, _No_throw_sentinel_for<_Out> _OSe> - requires constructible_from, iter_rvalue_reference_t<_It>> + requires (constructible_from, iter_rvalue_reference_t<_It>>) uninitialized_move_result<_It, _Out> _Uninitialized_move_unchecked( - _It _IFirst, _Se _ILast, _Out _OFirst, _OSe _OLast) { - // clang-format on - constexpr bool _Is_sized1 = sized_sentinel_for<_Se, _It>; - constexpr bool _Is_sized2 = sized_sentinel_for<_OSe, _Out>; - if constexpr (_Ptr_move_cat<_It, _Out>::_Really_trivial && _Sized_or_unreachable_sentinel_for<_Se, _It> // - && _Sized_or_unreachable_sentinel_for<_OSe, _Out>) { - if constexpr (_Is_sized1 && _Is_sized2) { - return _Copy_memcpy_common(_IFirst, _RANGES next(_IFirst, _STD move(_ILast)), _OFirst, - _RANGES next(_OFirst, _STD move(_OLast))); - } else if constexpr (_Is_sized1) { - return _Copy_memcpy_distance(_IFirst, _OFirst, _IFirst, _RANGES next(_IFirst, _STD move(_ILast))); - } else if constexpr (_Is_sized2) { - return _Copy_memcpy_distance(_IFirst, _OFirst, _OFirst, _RANGES next(_OFirst, _STD move(_OLast))); - } else { - _STL_ASSERT(false, "Tried to uninitialized_move two ranges with unreachable sentinels"); - } + _It _IFirst, _Se _ILast, _Out _OFirst, _OSe _OLast) { + // clang-format on + constexpr bool _Is_sized1 = sized_sentinel_for<_Se, _It>; + constexpr bool _Is_sized2 = sized_sentinel_for<_OSe, _Out>; + if constexpr (_Ptr_move_cat<_It, _Out>::_Really_trivial && _Sized_or_unreachable_sentinel_for<_Se, _It> // + && _Sized_or_unreachable_sentinel_for<_OSe, _Out>) { + if constexpr (_Is_sized1 && _Is_sized2) { + return _Copy_memcpy_common(_IFirst, _RANGES next(_IFirst, _STD move(_ILast)), _OFirst, + _RANGES next(_OFirst, _STD move(_OLast))); + } else if constexpr (_Is_sized1) { + return _Copy_memcpy_distance(_IFirst, _OFirst, _IFirst, _RANGES next(_IFirst, _STD move(_ILast))); + } else if constexpr (_Is_sized2) { + return _Copy_memcpy_distance(_IFirst, _OFirst, _OFirst, _RANGES next(_OFirst, _STD move(_OLast))); } else { - _Uninitialized_backout _Backout{_STD move(_OFirst)}; - - for (; _IFirst != _ILast && _Backout._Last != _OLast; ++_IFirst) { - _Backout._Emplace_back(_RANGES iter_move(_IFirst)); - } + _STL_ASSERT(false, "Tried to uninitialized_move two ranges with unreachable sentinels"); + } + } else { + _Uninitialized_backout _Backout{_STD move(_OFirst)}; - return {_STD move(_IFirst), _Backout._Release()}; + for (; _IFirst != _ILast && _Backout._Last != _OLast; ++_IFirst) { + _Backout._Emplace_back(_RANGES iter_move(_IFirst)); } + + return {_STD move(_IFirst), _Backout._Release()}; } + } } // namespace ranges #endif // __cpp_lib_concepts @@ -1922,7 +1920,7 @@ struct _In_place_key_extract_map<_Key, pair<_First, _Second>> { #pragma warning(disable : 4624) // '%s': destructor was implicitly defined as deleted template struct _Wrap { - _Ty _Value; // workaround for "T^ is not allowed in a union" + _Ty _Value; // workaround for VSO-586813 "T^ is not allowed in a union" }; #pragma warning(pop) @@ -1945,7 +1943,7 @@ struct _Alloc_temporary2 { _NODISCARD _CONSTEXPR20 const value_type& _Get_value() const noexcept { return _Storage._Value; } -#else // ^^^ workaround for "T^ is not allowed in a union" ^^^ / vvv no workaround vvv +#else // ^^^ workaround for VSO-586813 "T^ is not allowed in a union" ^^^ / vvv no workaround vvv union { value_type _Value; }; diff --git a/stl/inc/xutility b/stl/inc/xutility index dc3f747c32a..796c6a91fe3 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -278,15 +278,15 @@ struct contiguous_iterator_tag : random_access_iterator_tag {}; template using _With_reference = _Ty&; -// clang-format off template -concept _Can_reference = requires { typename _With_reference<_Ty>; }; +concept _Can_reference = requires { + typename _With_reference<_Ty>; +}; template concept _Dereferenceable = requires(_Ty& __t) { { *__t } -> _Can_reference; }; -// clang-format on template concept _Has_member_iterator_concept = requires { @@ -345,12 +345,12 @@ struct incrementable_traits<_Ty> { using difference_type = typename _Ty::difference_type; }; -// clang-format off template concept _Can_difference = requires(const _Ty& __a, const _Ty& __b) { { __a - __b } -> integral; }; +// clang-format off template requires (!_Has_member_difference_type<_Ty> && _Can_difference<_Ty>) struct incrementable_traits<_Ty> { @@ -423,11 +423,9 @@ using iter_reference_t = decltype(*_STD declval<_Ty&>()); template struct _Iterator_traits_base {}; -// clang-format off template -concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> && _Has_member_reference<_It> - && _Has_member_iterator_category<_It>; -// clang-format on +concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> // + && _Has_member_reference<_It> && _Has_member_iterator_category<_It>; template struct _Old_iter_traits_pointer { @@ -571,14 +569,12 @@ struct _Iter_traits_category3 { using _Apply = forward_iterator_tag; }; -// clang-format off template concept _Cpp17_bidi_delta = requires(_It __i) { { --__i } -> same_as<_It&>; { __i-- } -> convertible_to; requires same_as>; }; -// clang-format on template struct _Iter_traits_category2 { @@ -746,10 +742,8 @@ concept indirectly_writable = requires(_It&& __i, _Ty&& __t) { template concept _Integer_like = _Is_nonbool_integral>; -// clang-format off template concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); -// clang-format on template using _Make_unsigned_like_t = make_unsigned_t<_Ty>; @@ -971,20 +965,22 @@ struct incrementable_traits> { using difference_type = iter_difference_t<_It>; }; -// clang-format off template concept indirectly_movable = indirectly_readable<_In> && indirectly_writable<_Out, iter_rvalue_reference_t<_In>>; +// clang-format off template concept indirectly_movable_storable = indirectly_movable<_In, _Out> && indirectly_writable<_Out, iter_value_t<_In>> && movable> && constructible_from, iter_rvalue_reference_t<_In>> && assignable_from&, iter_rvalue_reference_t<_In> >; +// clang-format on template concept indirectly_copyable = indirectly_readable<_In> && indirectly_writable<_Out, iter_reference_t<_In>>; +// clang-format off template concept indirectly_copyable_storable = indirectly_copyable<_In, _Out> && indirectly_writable<_Out, iter_value_t<_In>&> @@ -1104,10 +1100,10 @@ concept mergeable = input_iterator<_It1> && input_iterator<_It2> && indirectly_copyable<_It1, _Out> && indirectly_copyable<_It2, _Out> && indirect_strict_weak_order<_Pr, projected<_It1, _Pj1>, projected<_It2, _Pj2>>; +// clang-format on template concept sortable = permutable<_It> && indirect_strict_weak_order<_Pr, projected<_It, _Proj>>; -// clang-format on template using _Iter_ref_t = iter_reference_t<_Iter>; @@ -1985,7 +1981,6 @@ namespace ranges { template void begin(const _Ty&) = delete; - // clang-format off template concept _Has_member = requires(_Ty __t) { { _Fake_decay_copy(__t.begin()) } -> input_or_output_iterator; @@ -1995,7 +1990,6 @@ namespace ranges { concept _Has_ADL = _Has_class_or_enum_type<_Ty> && requires(_Ty __t) { { _Fake_decay_copy(begin(__t)) } -> input_or_output_iterator; }; - // clang-format on class _Cpo { private: @@ -2051,7 +2045,6 @@ namespace ranges { using iterator_t = decltype(_RANGES begin(_STD declval<_Ty&>())); namespace _Unchecked_begin { - // clang-format off template concept _Has_member = requires(_Ty& __t) { { __t._Unchecked_begin() } -> input_or_output_iterator; @@ -2061,7 +2054,6 @@ namespace ranges { concept _Can_begin = requires(_Ty& __t) { _Get_unwrapped(_RANGES begin(__t)); }; - // clang-format on class _Cpo { private: @@ -2113,7 +2105,6 @@ namespace ranges { template void end(const _Ty&) = delete; - // clang-format off template concept _Has_member = requires(_Ty __t) { { _Fake_decay_copy(__t.end()) } -> sentinel_for>; @@ -2123,7 +2114,6 @@ namespace ranges { concept _Has_ADL = _Has_class_or_enum_type<_Ty> && requires(_Ty __t) { { _Fake_decay_copy(end(__t)) } -> sentinel_for>; }; - // clang-format on class _Cpo { private: @@ -2183,7 +2173,6 @@ namespace ranges { } namespace _Unchecked_end { - // clang-format off template concept _Has_member = _Unchecked_begin::_Has_member<_Ty> && requires(_Ty& __t) { __t._Unchecked_begin(); // required explicitly for better diagnostics @@ -2194,7 +2183,6 @@ namespace ranges { concept _Can_end = requires(_Ty& __t) { _Get_unwrapped(_RANGES end(__t)); }; - // clang-format on class _Cpo { private: @@ -2246,10 +2234,8 @@ namespace ranges { _RANGES end(__r); }; - // clang-format off template concept borrowed_range = range<_Rng> && _Should_range_access<_Rng>; - // clang-format on template using sentinel_t = decltype(_RANGES end(_STD declval<_Rng&>())); @@ -2302,7 +2288,6 @@ namespace ranges { template void rbegin(const _Ty&) = delete; - // clang-format off template concept _Has_member = requires(_Ty __t) { { _Fake_decay_copy(__t.rbegin()) } -> input_or_output_iterator; @@ -2318,7 +2303,6 @@ namespace ranges { { _RANGES begin(__t) } -> bidirectional_iterator; { _RANGES end(__t) } -> same_as; }; - // clang-format on class _Cpo { private: @@ -2372,7 +2356,6 @@ namespace ranges { template void rend(const _Ty&) = delete; - // clang-format off template concept _Has_member = requires(_Ty __t) { { _Fake_decay_copy(__t.rend()) } -> sentinel_for; @@ -2388,7 +2371,6 @@ namespace ranges { { _RANGES begin(__t) } -> bidirectional_iterator; { _RANGES end(__t) } -> same_as; }; - // clang-format on class _Cpo { private: @@ -2476,7 +2458,6 @@ namespace ranges { template void size(const _Ty&) = delete; - // clang-format off template concept _Has_member = !disable_sized_range<_UnCV> && requires(_Ty __t) { { _Fake_decay_copy(__t.size()) } -> _Integer_like; @@ -2492,7 +2473,6 @@ namespace ranges { { _RANGES begin(__t) } -> forward_iterator; { _RANGES end(__t) } -> sized_sentinel_for; }; - // clang-format on class _Cpo { private: @@ -2554,7 +2534,6 @@ namespace ranges { } namespace _Empty { - // clang-format off template concept _Has_member = requires(_Ty __t) { static_cast(__t.empty()); @@ -2570,7 +2549,6 @@ namespace ranges { { _RANGES begin(__t) } -> forward_iterator; _RANGES end(__t); }; - // clang-format on class _Cpo { private: @@ -2623,7 +2601,6 @@ namespace ranges { } namespace _Data { - // clang-format off template concept _Points_to_object = is_pointer_v<_Ty> && is_object_v>; @@ -2636,7 +2613,6 @@ namespace ranges { concept _Has_contiguous_iterator = requires(_Ty __t) { { _RANGES begin(__t) } -> contiguous_iterator; }; - // clang-format on class _Cpo { private: @@ -2695,12 +2671,10 @@ namespace ranges { inline constexpr _Cdata_fn cdata; } - // clang-format off template concept sized_range = range<_Rng> && requires(_Rng& __r) { _RANGES size(__r); }; - // clang-format on template using range_size_t = decltype(_RANGES size(_STD declval<_Rng&>())); @@ -2711,7 +2685,6 @@ namespace ranges { inline constexpr bool enable_view = derived_from<_Ty, view_base>; #ifdef __cpp_lib_ranges // TRANSITION, GH-1814 - // clang-format off template concept view = range<_Ty> && movable<_Ty> && enable_view<_Ty>; #endif // TRANSITION, GH-1814 @@ -2735,7 +2708,6 @@ namespace ranges { concept contiguous_range = range<_Rng> && contiguous_iterator> && requires(_Rng& __r) { { _RANGES data(__r) } -> same_as>>; }; - // clang-format on class _Not_quite_object { public: @@ -3033,14 +3005,15 @@ namespace ranges { using is_transparent = int; }; - // clang-format off template - concept common_range = range<_Rng> - && same_as, sentinel_t<_Rng>>; + concept common_range = range<_Rng> && same_as, sentinel_t<_Rng>>; template - concept _Can_empty = requires(_Ty __t) { _RANGES empty(__t); }; + concept _Can_empty = requires(_Ty __t) { + _RANGES empty(__t); + }; + // clang-format off template requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> class view_interface : public view_base { @@ -5174,10 +5147,10 @@ _NODISCARD _FwdIt find(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, const _ #ifdef __cpp_lib_concepts namespace ranges { - // clang-format off template concept _Sized_or_unreachable_sentinel_for = sized_sentinel_for<_Se, _It> || same_as<_Se, unreachable_sentinel_t>; + // clang-format off // concept-constrained for strict enforcement as it is used by several algorithms template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> diff --git a/stl/src/atomic_wait.cpp b/stl/src/atomic_wait.cpp index a5a220f464d..343cf31aaa7 100644 --- a/stl/src/atomic_wait.cpp +++ b/stl/src/atomic_wait.cpp @@ -3,15 +3,12 @@ // implement atomic wait / notify_one / notify_all -// clang-format off - #include #include #include #include -#include -// clang-format on +#include namespace { diff --git a/stl/src/xrngabort.cpp b/stl/src/xrngabort.cpp index 87642321b95..43ef28bb3c3 100644 --- a/stl/src/xrngabort.cpp +++ b/stl/src/xrngabort.cpp @@ -8,7 +8,6 @@ #include #include -// clang-format off _STD_BEGIN // TRANSITION, ABI: _Rng_abort() is preserved for binary compatibility [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Rng_abort(_In_z_ const char* _Msg) { @@ -18,4 +17,3 @@ _STD_BEGIN _CSTD abort(); } _STD_END -// clang-format on diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index dad6843ab83..2ebee42e336 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -156,7 +156,6 @@ namespace test { } }; - // clang-format off template concept CanEq = requires(T const& t, U const& u) { { t == u } -> convertible_to; @@ -186,7 +185,6 @@ namespace test { concept CanGtE = requires(T const& t, U const& u) { { t >= u } -> convertible_to; }; - // clang-format on template class proxy_reference { diff --git a/tests/std/tests/P0067R5_charconv/wchar_test_cases.hpp b/tests/std/tests/P0067R5_charconv/wchar_test_cases.hpp index 795ac517987..9037902cacb 100644 --- a/tests/std/tests/P0067R5_charconv/wchar_test_cases.hpp +++ b/tests/std/tests/P0067R5_charconv/wchar_test_cases.hpp @@ -37,131 +37,131 @@ inline constexpr DoublePrecisionToWideTestCase wide_digit_pairs_test_cases[] = { inline constexpr DoubleToWideTestCase double_to_wide_test_cases[] = { // Test special cases (zero, inf, nan) and an ordinary case. Also test negative signs. {0.0, chars_format::scientific, L"0e+00"}, - //{-0.0, chars_format::scientific, L"-0e+00"}, - //{double_inf, chars_format::scientific, L"inf"}, - //{-double_inf, chars_format::scientific, L"-inf"}, - //{double_nan, chars_format::scientific, L"nan"}, - //{-double_nan, chars_format::scientific, L"-nan(ind)"}, - //{double_nan_payload, chars_format::scientific, L"nan"}, - //{-double_nan_payload, chars_format::scientific, L"-nan"}, + // {-0.0, chars_format::scientific, L"-0e+00"}, + // {double_inf, chars_format::scientific, L"inf"}, + // {-double_inf, chars_format::scientific, L"-inf"}, + // {double_nan, chars_format::scientific, L"nan"}, + // {-double_nan, chars_format::scientific, L"-nan(ind)"}, + // {double_nan_payload, chars_format::scientific, L"nan"}, + // {-double_nan_payload, chars_format::scientific, L"-nan"}, {2.018, chars_format::scientific, L"2.018e+00"}, - //{-2.018, chars_format::scientific, L"-2.018e+00"}, + // {-2.018, chars_format::scientific, L"-2.018e+00"}, {0.2018, chars_format::scientific, L"2.018e-01"}, - //{-0.2018, chars_format::scientific, L"-2.018e-01"}, + // {-0.2018, chars_format::scientific, L"-2.018e-01"}, // Ditto for fixed, which doesn't emit exponents. {0.0, chars_format::fixed, L"0"}, - //{-0.0, chars_format::fixed, L"-0"}, - //{double_inf, chars_format::fixed, L"inf"}, - //{-double_inf, chars_format::fixed, L"-inf"}, - //{double_nan, chars_format::fixed, L"nan"}, - //{-double_nan, chars_format::fixed, L"-nan(ind)"}, - //{double_nan_payload, chars_format::fixed, L"nan"}, - //{-double_nan_payload, chars_format::fixed, L"-nan"}, + // {-0.0, chars_format::fixed, L"-0"}, + // {double_inf, chars_format::fixed, L"inf"}, + // {-double_inf, chars_format::fixed, L"-inf"}, + // {double_nan, chars_format::fixed, L"nan"}, + // {-double_nan, chars_format::fixed, L"-nan(ind)"}, + // {double_nan_payload, chars_format::fixed, L"nan"}, + // {-double_nan_payload, chars_format::fixed, L"-nan"}, {2.018, chars_format::fixed, L"2.018"}, - //{-2.018, chars_format::fixed, L"-2.018"}, + // {-2.018, chars_format::fixed, L"-2.018"}, // Ditto for general, which selects fixed for the scientific exponent 0. {0.0, chars_format::general, L"0"}, - //{-0.0, chars_format::general, L"-0"}, - //{double_inf, chars_format::general, L"inf"}, - //{-double_inf, chars_format::general, L"-inf"}, - //{double_nan, chars_format::general, L"nan"}, - //{-double_nan, chars_format::general, L"-nan(ind)"}, - //{double_nan_payload, chars_format::general, L"nan"}, - //{-double_nan_payload, chars_format::general, L"-nan"}, + // {-0.0, chars_format::general, L"-0"}, + // {double_inf, chars_format::general, L"inf"}, + // {-double_inf, chars_format::general, L"-inf"}, + // {double_nan, chars_format::general, L"nan"}, + // {-double_nan, chars_format::general, L"-nan(ind)"}, + // {double_nan_payload, chars_format::general, L"nan"}, + // {-double_nan_payload, chars_format::general, L"-nan"}, {2.018, chars_format::general, L"2.018"}, - //{-2.018, chars_format::general, L"-2.018"}, + // {-2.018, chars_format::general, L"-2.018"}, // Ditto for plain, which selects fixed because it's shorter for these values. {0.0, chars_format{}, L"0"}, - //{-0.0, chars_format{}, L"-0"}, - //{double_inf, chars_format{}, L"inf"}, - //{-double_inf, chars_format{}, L"-inf"}, - //{double_nan, chars_format{}, L"nan"}, - //{-double_nan, chars_format{}, L"-nan(ind)"}, - //{double_nan_payload, chars_format{}, L"nan"}, - //{-double_nan_payload, chars_format{}, L"-nan"}, + // {-0.0, chars_format{}, L"-0"}, + // {double_inf, chars_format{}, L"inf"}, + // {-double_inf, chars_format{}, L"-inf"}, + // {double_nan, chars_format{}, L"nan"}, + // {-double_nan, chars_format{}, L"-nan(ind)"}, + // {double_nan_payload, chars_format{}, L"nan"}, + // {-double_nan_payload, chars_format{}, L"-nan"}, {2.018, chars_format{}, L"2.018"}, - //{-2.018, chars_format{}, L"-2.018"}, + // {-2.018, chars_format{}, L"-2.018"}, // Ditto for hex. - //{0.0, chars_format::hex, L"0p+0"}, - //{-0.0, chars_format::hex, L"-0p+0"}, - //{double_inf, chars_format::hex, L"inf"}, - //{-double_inf, chars_format::hex, L"-inf"}, - //{double_nan, chars_format::hex, L"nan"}, - //{-double_nan, chars_format::hex, L"-nan(ind)"}, - //{double_nan_payload, chars_format::hex, L"nan"}, - //{-double_nan_payload, chars_format::hex, L"-nan"}, - //{0x1.729p+0, chars_format::hex, L"1.729p+0"}, - //{-0x1.729p+0, chars_format::hex, L"-1.729p+0"}, - //{0x1.729p-1, chars_format::hex, L"1.729p-1"}, - //{-0x1.729p-1, chars_format::hex, L"-1.729p-1"}, + // {0.0, chars_format::hex, L"0p+0"}, + // {-0.0, chars_format::hex, L"-0p+0"}, + // {double_inf, chars_format::hex, L"inf"}, + // {-double_inf, chars_format::hex, L"-inf"}, + // {double_nan, chars_format::hex, L"nan"}, + // {-double_nan, chars_format::hex, L"-nan(ind)"}, + // {double_nan_payload, chars_format::hex, L"nan"}, + // {-double_nan_payload, chars_format::hex, L"-nan"}, + // {0x1.729p+0, chars_format::hex, L"1.729p+0"}, + // {-0x1.729p+0, chars_format::hex, L"-1.729p+0"}, + // {0x1.729p-1, chars_format::hex, L"1.729p-1"}, + // {-0x1.729p-1, chars_format::hex, L"-1.729p-1"}, }; inline constexpr FloatToWideTestCase float_to_wide_test_cases[] = { // Test special cases (zero, inf, nan) and an ordinary case. Also test negative signs. {0.0f, chars_format::scientific, L"0e+00"}, - //{-0.0f, chars_format::scientific, L"-0e+00"}, - //{float_inf, chars_format::scientific, L"inf"}, - //{-float_inf, chars_format::scientific, L"-inf"}, - //{float_nan, chars_format::scientific, L"nan"}, - //{-float_nan, chars_format::scientific, L"-nan(ind)"}, - //{float_nan_payload, chars_format::scientific, L"nan"}, - //{-float_nan_payload, chars_format::scientific, L"-nan"}, + // {-0.0f, chars_format::scientific, L"-0e+00"}, + // {float_inf, chars_format::scientific, L"inf"}, + // {-float_inf, chars_format::scientific, L"-inf"}, + // {float_nan, chars_format::scientific, L"nan"}, + // {-float_nan, chars_format::scientific, L"-nan(ind)"}, + // {float_nan_payload, chars_format::scientific, L"nan"}, + // {-float_nan_payload, chars_format::scientific, L"-nan"}, {2.018f, chars_format::scientific, L"2.018e+00"}, - //{-2.018f, chars_format::scientific, L"-2.018e+00"}, + // {-2.018f, chars_format::scientific, L"-2.018e+00"}, {0.2018f, chars_format::scientific, L"2.018e-01"}, - //{-0.2018f, chars_format::scientific, L"-2.018e-01"}, + // {-0.2018f, chars_format::scientific, L"-2.018e-01"}, // Ditto for fixed, which doesn't emit exponents. {0.0f, chars_format::fixed, L"0"}, - //{-0.0f, chars_format::fixed, L"-0"}, - //{float_inf, chars_format::fixed, L"inf"}, - //{-float_inf, chars_format::fixed, L"-inf"}, - //{float_nan, chars_format::fixed, L"nan"}, - //{-float_nan, chars_format::fixed, L"-nan(ind)"}, - //{float_nan_payload, chars_format::fixed, L"nan"}, - //{-float_nan_payload, chars_format::fixed, L"-nan"}, + // {-0.0f, chars_format::fixed, L"-0"}, + // {float_inf, chars_format::fixed, L"inf"}, + // {-float_inf, chars_format::fixed, L"-inf"}, + // {float_nan, chars_format::fixed, L"nan"}, + // {-float_nan, chars_format::fixed, L"-nan(ind)"}, + // {float_nan_payload, chars_format::fixed, L"nan"}, + // {-float_nan_payload, chars_format::fixed, L"-nan"}, {2.018f, chars_format::fixed, L"2.018"}, - //{-2.018f, chars_format::fixed, L"-2.018"}, + // {-2.018f, chars_format::fixed, L"-2.018"}, // Ditto for general, which selects fixed for the scientific exponent 0. {0.0f, chars_format::general, L"0"}, - //{-0.0f, chars_format::general, L"-0"}, - //{float_inf, chars_format::general, L"inf"}, - //{-float_inf, chars_format::general, L"-inf"}, - //{float_nan, chars_format::general, L"nan"}, - //{-float_nan, chars_format::general, L"-nan(ind)"}, - //{float_nan_payload, chars_format::general, L"nan"}, - //{-float_nan_payload, chars_format::general, L"-nan"}, + // {-0.0f, chars_format::general, L"-0"}, + // {float_inf, chars_format::general, L"inf"}, + // {-float_inf, chars_format::general, L"-inf"}, + // {float_nan, chars_format::general, L"nan"}, + // {-float_nan, chars_format::general, L"-nan(ind)"}, + // {float_nan_payload, chars_format::general, L"nan"}, + // {-float_nan_payload, chars_format::general, L"-nan"}, {2.018f, chars_format::general, L"2.018"}, - //{-2.018f, chars_format::general, L"-2.018"}, + // {-2.018f, chars_format::general, L"-2.018"}, // Ditto for plain, which selects fixed because it's shorter for these values. {0.0f, chars_format{}, L"0"}, - //{-0.0f, chars_format{}, L"-0"}, - //{float_inf, chars_format{}, L"inf"}, - //{-float_inf, chars_format{}, L"-inf"}, - //{float_nan, chars_format{}, L"nan"}, - //{-float_nan, chars_format{}, L"-nan(ind)"}, - //{float_nan_payload, chars_format{}, L"nan"}, - //{-float_nan_payload, chars_format{}, L"-nan"}, + // {-0.0f, chars_format{}, L"-0"}, + // {float_inf, chars_format{}, L"inf"}, + // {-float_inf, chars_format{}, L"-inf"}, + // {float_nan, chars_format{}, L"nan"}, + // {-float_nan, chars_format{}, L"-nan(ind)"}, + // {float_nan_payload, chars_format{}, L"nan"}, + // {-float_nan_payload, chars_format{}, L"-nan"}, {2.018f, chars_format{}, L"2.018"}, - //{-2.018f, chars_format{}, L"-2.018"}, + // {-2.018f, chars_format{}, L"-2.018"}, // Ditto for hex. - //{0.0f, chars_format::hex, L"0p+0"}, - //{-0.0f, chars_format::hex, L"-0p+0"}, - //{float_inf, chars_format::hex, L"inf"}, - //{-float_inf, chars_format::hex, L"-inf"}, - //{float_nan, chars_format::hex, L"nan"}, - //{-float_nan, chars_format::hex, L"-nan(ind)"}, - //{float_nan_payload, chars_format::hex, L"nan"}, - //{-float_nan_payload, chars_format::hex, L"-nan"}, - //{0x1.729p+0f, chars_format::hex, L"1.729p+0"}, - //{-0x1.729p+0f, chars_format::hex, L"-1.729p+0"}, - //{0x1.729p-1f, chars_format::hex, L"1.729p-1"}, - //{-0x1.729p-1f, chars_format::hex, L"-1.729p-1"}, + // {0.0f, chars_format::hex, L"0p+0"}, + // {-0.0f, chars_format::hex, L"-0p+0"}, + // {float_inf, chars_format::hex, L"inf"}, + // {-float_inf, chars_format::hex, L"-inf"}, + // {float_nan, chars_format::hex, L"nan"}, + // {-float_nan, chars_format::hex, L"-nan(ind)"}, + // {float_nan_payload, chars_format::hex, L"nan"}, + // {-float_nan_payload, chars_format::hex, L"-nan"}, + // {0x1.729p+0f, chars_format::hex, L"1.729p+0"}, + // {-0x1.729p+0f, chars_format::hex, L"-1.729p+0"}, + // {0x1.729p-1f, chars_format::hex, L"1.729p-1"}, + // {-0x1.729p-1f, chars_format::hex, L"-1.729p-1"}, }; diff --git a/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp b/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp index 66bec4ea7da..26402e94600 100644 --- a/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp +++ b/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp @@ -21,17 +21,15 @@ DURATION_TEST(weeks, 22, ratio_multiply, days::period>) DURATION_TEST(months, 20, ratio_divide>) DURATION_TEST(years, 17, ratio_multiply, days::period>) -// clang-format off -static_assert(is_same_v>, +static_assert(is_same_v>, // "sys_seconds is not time_point."); -static_assert(is_same_v>, +static_assert(is_same_v>, // "sys_days is not time_point."); -static_assert(is_same_v>, +static_assert(is_same_v>, // "local_seconds is not time_point."); -static_assert(is_same_v>, +static_assert(is_same_v>, // "local_days is not time_point."); -// clang-format on constexpr bool test() { steady_clock::time_point tp1; diff --git a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp index af6dedda278..fa26913d3fc 100644 --- a/tests/std/tests/P0811R3_midpoint_lerp/test.cpp +++ b/tests/std/tests/P0811R3_midpoint_lerp/test.cpp @@ -114,12 +114,9 @@ constexpr float mint_nan(const bool sign, const unsigned long long payloa const unsigned int filteredPayload = payload & 0x3F'FFFFu; // bottom 22 bits assert(filteredPayload == payload); // if this assert fails, payload didn't fit - // clang-format off - const unsigned int result = - (static_cast(sign) << 31) - | 0x7FC0'0000u // turn on all exponent bits and the qNaN bit - | filteredPayload; - // clang-format on + const unsigned int result = (static_cast(sign) << 31) + | 0x7FC0'0000u // turn on all exponent bits and the qNaN bit + | filteredPayload; return bit_cast(result); } @@ -129,12 +126,9 @@ constexpr double mint_nan(const bool sign, const unsigned long long payl const unsigned long long filteredPayload = payload & 0x7'FFFF'FFFF'FFFFllu; // bottom 51 bits assert(filteredPayload == payload); // if this assert fails, payload didn't fit - // clang-format off - const unsigned long long result = - (static_cast(sign) << 63) - | 0x7FF8'0000'0000'0000u // turn on all exponent bits and the qNaN bit - | filteredPayload; - // clang-format on + const unsigned long long result = (static_cast(sign) << 63) + | 0x7FF8'0000'0000'0000u // turn on all exponent bits and the qNaN bit + | filteredPayload; return bit_cast(result); } diff --git a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp index 9b0ce11187f..953826b4b2a 100644 --- a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp @@ -1561,7 +1561,6 @@ struct badsized_range : Base { // size() launches the missiles. badsized_range(badsized_range&&) = default; badsized_range& operator=(badsized_range&&) = default; - // clang-format off [[noreturn]] int size() const { static_assert(always_false); } @@ -1569,7 +1568,6 @@ struct badsized_range : Base { // size() launches the missiles. [[noreturn]] friend int size(const badsized_range&) { static_assert(always_false); } - // clang-format on }; using mutable_badsized_range = badsized_range; diff --git a/tests/std/tests/P0896R4_ranges_ref_view/test.cpp b/tests/std/tests/P0896R4_ranges_ref_view/test.cpp index 1105f717aa8..cf710708cf6 100644 --- a/tests/std/tests/P0896R4_ranges_ref_view/test.cpp +++ b/tests/std/tests/P0896R4_ranges_ref_view/test.cpp @@ -12,14 +12,18 @@ #include using namespace std; -// clang-format off template -concept can_empty = requires(Range& r) { ranges::empty(r); }; +concept can_empty = requires(Range& r) { + ranges::empty(r); +}; template -concept can_data = requires(Range& r) { ranges::data(r); }; +concept can_data = requires(Range& r) { + ranges::data(r); +}; template -concept can_size = requires(Range& r) { ranges::size(r); }; -// clang-format on +concept can_size = requires(Range& r) { + ranges::size(r); +}; struct instantiator { template diff --git a/tests/std/tests/P0896R4_ranges_subrange/test.compile.pass.cpp b/tests/std/tests/P0896R4_ranges_subrange/test.compile.pass.cpp index 46c7dc3e4cc..66a2c6b0656 100644 --- a/tests/std/tests/P0896R4_ranges_subrange/test.compile.pass.cpp +++ b/tests/std/tests/P0896R4_ranges_subrange/test.compile.pass.cpp @@ -771,7 +771,6 @@ namespace test_subrange { STATIC_ASSERT(!CanSubrange); STATIC_ASSERT(CanSubrange); - // clang-format off template concept HasMemberEmpty = requires(std::remove_reference_t const r) { { r.empty() } -> same_as; @@ -781,7 +780,6 @@ namespace test_subrange { concept HasMemberSize = requires(std::remove_reference_t const r) { { r.size() } -> std::integral; }; - // clang-format on // Validate default template arguments: second defaults to first, and third defaults to subrange_kind::sized iff // sized_sentinel_for. diff --git a/tests/std/tests/P0896R4_ranges_test_machinery/test.compile.pass.cpp b/tests/std/tests/P0896R4_ranges_test_machinery/test.compile.pass.cpp index 276b703c5c8..d3ac3164f3e 100644 --- a/tests/std/tests/P0896R4_ranges_test_machinery/test.compile.pass.cpp +++ b/tests/std/tests/P0896R4_ranges_test_machinery/test.compile.pass.cpp @@ -151,13 +151,11 @@ STATIC_ASSERT( STATIC_ASSERT(same_as<_Unwrapped_t>, test::sentinel>); // Validate test::range -// clang-format off template concept has_member_size = requires(const R& r) { typename ranges::range_size_t; { r.size() } -> same_as>; }; -// clang-format on using test::Sized, test::Common; diff --git a/tests/std/tests/P0896R4_views_join/test.cpp b/tests/std/tests/P0896R4_views_join/test.cpp index 7b233f80c21..b6cc29fc3f9 100644 --- a/tests/std/tests/P0896R4_views_join/test.cpp +++ b/tests/std/tests/P0896R4_views_join/test.cpp @@ -31,10 +31,7 @@ constexpr bool test_one(Outer&& rng, Expected&& expected) { using Inner = range_value_t; constexpr bool deref_is_glvalue = is_reference_v>; - // clang-format off - constexpr bool can_test = ranges::viewable_range - && input_range>; - // clang-format on + constexpr bool can_test = ranges::viewable_range && input_range>; if constexpr (can_test) { using V = views::all_t; diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index c78df009118..829f09e1ae7 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -23,7 +23,7 @@ #define _USE_NAMED_IDL_NAMESPACE 1 #include -//#include // All templates instantiated in P0220R1_any +// #include // All templates instantiated in P0220R1_any #include #include #include @@ -73,7 +73,7 @@ #include #include #include -//#include // All templates instantiated in P0220R1_optional +// #include // All templates instantiated in P0220R1_optional #include #include #include @@ -89,7 +89,7 @@ #include #include #include -//#include // All templates instantiated in P0088R3_variant +// #include // All templates instantiated in P0088R3_variant #include // Headers not allowed with /clr:pure