From 7433536b3d864c0d8d5180348690e1c280a3eaf2 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 19 Feb 2020 22:00:14 +0000 Subject: [PATCH] libstdc++: Add default-initializers to views (LWG 3364) * include/std/ranges (take_while_view, drop_view, drop_while_view) (elements_view:_Iterator): Initialize data members (LWG 3364). --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/std/ranges | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 622c294..ef91b80 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2020-02-19 Jonathan Wakely + * include/std/ranges (take_while_view, drop_view, drop_while_view) + (elements_view:_Iterator): Initialize data members (LWG 3364). + * libsupc++/compare (three_way_comparable): Remove always-false check that should have been removed with weak_equality (P1959R0). (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360). diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index b348ba2..7a66491 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -2008,7 +2008,7 @@ namespace views { return __y._M_end == __x || !std::__invoke(*__y._M_pred, *__x); } }; - _Vp _M_base; + _Vp _M_base = _Vp(); __detail::__box<_Pred> _M_pred; public: @@ -2068,8 +2068,8 @@ namespace views class drop_view : public view_interface> { private: - _Vp _M_base; - range_difference_t<_Vp> _M_count; + _Vp _M_base = _Vp(); + range_difference_t<_Vp> _M_count = 0; public: drop_view() = default; @@ -2147,7 +2147,7 @@ namespace views class drop_while_view : public view_interface> { private: - _Vp _M_base; + _Vp _M_base = _Vp(); __detail::__box<_Pred> _M_pred; public: @@ -3179,7 +3179,7 @@ namespace views { using _Base = conditional_t<_Const, const _Vp, _Vp>; - iterator_t<_Base> _M_current; + iterator_t<_Base> _M_current = iterator_t<_Base>(); friend _Iterator; -- 2.7.4