From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id F29DE383F400; Mon, 2 Aug 2021 19:30:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F29DE383F400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-2675] libstdc++: Fix up implementation of LWG 3533 [PR101589] X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: 0e1bb3c88c7bd624bc34d6cebe3df9532f1858f0 X-Git-Newrev: 4414057186b227edf5b5efa527732bfcdf39d575 Message-Id: <20210802193041.F29DE383F400@sourceware.org> Date: Mon, 2 Aug 2021 19:30:41 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 19:30:42 -0000 https://gcc.gnu.org/g:4414057186b227edf5b5efa527732bfcdf39d575 commit r12-2675-g4414057186b227edf5b5efa527732bfcdf39d575 Author: Patrick Palka Date: Mon Aug 2 15:30:13 2021 -0400 libstdc++: Fix up implementation of LWG 3533 [PR101589] In r12-569 I accidentally applied the LWG 3533 change to elements_view::iterator::base instead to elements_view::base. This patch corrects this, and also applies the corresponding LWG 3533 change to lazy_split_view::inner-iter::base now that we implement P2210. PR libstdc++/101589 libstdc++-v3/ChangeLog: * include/std/ranges (lazy_split_view::_InnerIter::base): Make the const& overload unconstrained and return a const reference as per LWG 3533. Make unconditionally noexcept. (elements_view::base): Revert accidental r12-569 change. (elements_view::_Iterator::base): Make the const& overload unconstrained and return a const reference as per LWG 3533. Make unconditionally noexcept. Diff: --- libstdc++-v3/include/std/ranges | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 0df59e8990c..5bdcd445a9e 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -3103,8 +3103,8 @@ namespace views::__adaptor : _M_i(std::move(__i)) { } - constexpr iterator_t<_Base> - base() const& requires copyable> + constexpr const iterator_t<_Base>& + base() const& noexcept { return _M_i_current(); } constexpr iterator_t<_Base> @@ -3786,8 +3786,8 @@ namespace views::__adaptor : _M_base(std::move(base)) { } - constexpr const _Vp& - base() const & noexcept + constexpr _Vp + base() const& requires copy_constructible<_Vp> { return _M_base; } constexpr _Vp @@ -3913,9 +3913,8 @@ namespace views::__adaptor : _M_current(std::move(i._M_current)) { } - constexpr iterator_t<_Base> - base() const& - requires copyable> + constexpr const iterator_t<_Base>& + base() const& noexcept { return _M_current; } constexpr iterator_t<_Base>