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 ESMTPS id B13C23858429 for ; Fri, 9 Sep 2022 17:24:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B13C23858429 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662744291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LacF4wdjEbYMqFdNQMkcThSU/UCJy0jw326JIjtpV0Q=; b=HS9u+8mvm/i7h3o4Gbugx/D0yAKK9RFKShle6E1dqKk+PS+Zp5r+3ngfiSZO/k4Jgt1SFl l+NOGLQRo+PtvFz+tx3rl2DSl/jY23C1syFvZArd7goQUw3iZGWlKYPu1/cSDWyn2O+KSH 4CzwUiJI4JSHKAA3yNsNRnKe61eqE60= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-590-q-S6aIFpPLCNBtky6EtZZg-1; Fri, 09 Sep 2022 13:24:50 -0400 X-MC-Unique: q-S6aIFpPLCNBtky6EtZZg-1 Received: by mail-qt1-f198.google.com with SMTP id cm10-20020a05622a250a00b003437b745ccdso2005933qtb.18 for ; Fri, 09 Sep 2022 10:24:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=LacF4wdjEbYMqFdNQMkcThSU/UCJy0jw326JIjtpV0Q=; b=VAbTofa5SNZtRvUUh17Oja88UNvYgqY6EUZAFZ8LMxpY8aOFSsfWdwgajbitgW+dy8 6GWKVPkdXNZf7itK3hMxQfcwar6g5gvCQVmh8GDuUV/4y7m77YBS9ZSVJn06UJWMBBIT V6Z5z1EHgzYEIJK7rItz2Kf4zb4frk0fLQ8fIcOmfQFnXNx+osxQyKgmnbRRyysaTNX/ 99gOmvVA4dT+Rspsdi141tfdEsaiaZoduqMptqItsxIDbTbCaUQ1Kqh11sfl2Y+TAgmA ry2fErvTQnBNSy+amHrkfjcd6bJgabjtHHPbRuey/u3rELLnS47jvMJMa+oRUk3Wi9ZS BUuQ== X-Gm-Message-State: ACgBeo2bSqdRai3LVz2UOJLhPckC7qznnDV3hLecGmUrVzuTfqskvLDa XVSETuEgyBv85+vWE28ylNuOOlM8uDJMJvNTcZ1ecwi99Ax1/PjoQSV/GpMZVBcJ9qsTxxHwlCZ Qejh56Hq5w1bM1Xk= X-Received: by 2002:a05:620a:2239:b0:6be:91e8:c9dc with SMTP id n25-20020a05620a223900b006be91e8c9dcmr10810453qkh.305.1662744289958; Fri, 09 Sep 2022 10:24:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JpCoRVYPmXL+pECR7boql1gEcIYtyY5N25psi9MLmWHc4vLLVfE+WSNNFUHmBSGfU6oULUQ== X-Received: by 2002:a05:620a:2239:b0:6be:91e8:c9dc with SMTP id n25-20020a05620a223900b006be91e8c9dcmr10810444qkh.305.1662744289713; Fri, 09 Sep 2022 10:24:49 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id f5-20020a05622a1a0500b003445bb107basm820250qtb.75.2022.09.09.10.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 10:24:49 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka Subject: [PATCH 2/3] libstdc++: Fix typo in adjacent_view::_Iterator [PR106798] Date: Fri, 9 Sep 2022 13:24:45 -0400 Message-Id: <20220909172446.1546805-2-ppalka@redhat.com> X-Mailer: git-send-email 2.37.3.518.g79f2338b37 In-Reply-To: <20220909172446.1546805-1-ppalka@redhat.com> References: <20220909172446.1546805-1-ppalka@redhat.com> 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-default=true X-Spam-Status: No, score=-14.3 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,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: PR libstdc++/106798 libstdc++-v3/ChangeLog: * include/std/ranges (adjacent_view::_Iterator::_Iterator): Fix typo. * testsuite/std/ranges/adaptors/adjacent/1.cc (test04): New test. --- libstdc++-v3/include/std/ranges | 2 +- .../testsuite/std/ranges/adaptors/adjacent/1.cc | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 2b8fec3c386..37ad80ad3de 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -5239,7 +5239,7 @@ namespace views::__adaptor requires _Const && convertible_to, iterator_t<_Base>> { for (size_t __j = 0; __j < _Nm; ++__j) - _M_current[__j] = std::move(__i[__j]); + _M_current[__j] = std::move(__i._M_current[__j]); } constexpr auto diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc index 9829f79364f..443c1fbf450 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc @@ -101,10 +101,22 @@ test03() return true; } +constexpr bool +test04() +{ + // PR libstdc++/106798 + auto r = views::single(0) | views::lazy_split(0) | views::pairwise; + decltype(ranges::cend(r)) s = r.end(); + VERIFY( r.begin() == s ); + + return true; +} + int main() { static_assert(test01()); static_assert(test02()); static_assert(test03()); + static_assert(test04()); } -- 2.37.3.518.g79f2338b37