From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D2C9939A8428 for ; Fri, 23 Jul 2021 16:34:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2C9939A8428 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-506-TXG4An8nMaWADepVV94SGQ-1; Fri, 23 Jul 2021 12:34:14 -0400 X-MC-Unique: TXG4An8nMaWADepVV94SGQ-1 Received: by mail-qk1-f197.google.com with SMTP id w2-20020a3794020000b02903b54f40b442so1610880qkd.0 for ; Fri, 23 Jul 2021 09:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/7e9ric9Mpk0Baawl3A2Yn1XQl3UyUtA0zOIv8bTHF0=; b=mdnV513u74I1uPxX4RFqao5VFdfcQMd1mPuOknab+NywybP2CCsQNPy//LGRjzChLe IgkPbh/y1vHFlFR2x5R7B7GJzN22CUQQGTuHN/byzwyc6faUMIx2cSb5kXOTGHEfXa9l 9sWyZFfCdv52+/RMO7miSHoYLtJ5ZoAbNIttIf3/lAj8+2KczE9Ncle1w+49PGnz225C P5WqfLjniFKhSCvPM0pXEf2bXs7gOnbM2tq3/861HcbBY2XQ+ZdMalrkGt0uwh4KHTzv xhLYzd4iQJWvBtAP0m67QaqyTzJlZCL24TTmvbgaTnFcMKdTuJ5hDDT0+PgNzBUCM0e9 5FJw== X-Gm-Message-State: AOAM533KyLWlFkw+kmrgfi/K8N9nx6Wn1ReBH1lpgIASq+xK5RfS5+fk YAcyrkX1O7PirGAVVt3bY23Bp5+Mbf5KJXuhHk+sCZb9/JjfRciq2h9r7FPhi32Upcu0kcaniYq 8/qHzxz9QUZmpKE4= X-Received: by 2002:ac8:6b45:: with SMTP id x5mr4646636qts.249.1627058053622; Fri, 23 Jul 2021 09:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws8ep9U8SBJ19BwMMgTo3507GYyfuBehLLV/nwI7HKD/zKdo3mrAquFf/K6OISuX0+ySr0FQ== X-Received: by 2002:ac8:6b45:: with SMTP id x5mr4646617qts.249.1627058053397; Fri, 23 Jul 2021 09:34:13 -0700 (PDT) Received: from localhost.localdomain (ool-457d493a.dyn.optonline.net. [69.125.73.58]) by smtp.gmail.com with ESMTPSA id i24sm8109073qki.61.2021.07.23.09.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 09:34:12 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka Subject: [PATCH] libstdc++: Fix up implementation of LWG 3533 [PR101589] Date: Fri, 23 Jul 2021 12:34:10 -0400 Message-Id: <20210723163410.3292780-1-ppalka@redhat.com> X-Mailer: git-send-email 2.32.0.349.gdaab8a564f MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-16.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 16:34:19 -0000 In r12-569 I accidentally applied the LWG 3533 change that was intended for elements_view::iterator::base to elements_view::base instead. This patch corrects this, and also applies the corresponding LWG 3533 change to lazy_split_view::inner-iter::base now that we implement P2210. Tested on x86_64-pc-linux-gnu, does this look OK for trunk and release branches? 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. --- 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 d791e15d096..50b414e8c8c 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> -- 2.32.0.349.gdaab8a564f