From patchwork Fri Sep 9 17:24:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1122 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp816697wrt; Fri, 9 Sep 2022 10:26:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6YoThUwPneusrEHIVZi9kYpCbJiLWLzupXQu95ktu437y9euz2EvE+UuTACLByqac8GjLM X-Received: by 2002:a17:906:eecb:b0:73c:5bcb:8eb3 with SMTP id wu11-20020a170906eecb00b0073c5bcb8eb3mr10506187ejb.284.1662744407564; Fri, 09 Sep 2022 10:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662744407; cv=none; d=google.com; s=arc-20160816; b=zthOTKa34VjB3K3RwUv5yvba7zhf9Vl0tRr7m0RV8M3D2pp7PfLhPOGCc1IoSLlHv7 /SyUoudPxOLe4AuCR1wmnV3FrzHzrwDk6L3nn9bTcPQeY83AxG9Vahr3/Noii2w+Ta2O uo4FqWarYY5zIykxe9Q52kR/qi7oW9JraPETO7tTNTUBDIuTE57w36N2RzMWL+Qes+Cv 0LOAnsatfl5Vmh4WxYLZbw1Yo91ARiQIER4vxi+enZ43IRZ3ITzekg7lf9JQFRQpxEdb j3ejwhLA/z9F0B4Suwdbc+XFi1/xAd9qjOisj63WsEvPGQcNkFVd+ME3nMPL0zKoL710 4Z4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=XtqysvV+0feIrrp2qkv2T8g/2vSEkm70iZThsfB+EhM=; b=BwqpFPHyJ0Gs0RG3ltH4GE8rr2vzLirIPgsNqG71pENTPeV6r2ES2k0Xh0vJ+x1T/q +z9J+OkwUOhqiFsMBkAPXzDMbclcd4Z4GTwDFUHOIilZbWRGCQ5cuC5FticNl2FeOZA0 0uIlhxooxxWk8Xk2VnCcetRmzFBCbkj3EZtt04aPiMH1KptfoVSEYNQGm8ZcDyAy4ySq /YoHxB4iJnm+fYBtewCv6ZaoG6JjVr4TncKC+dZCnkps/CPtVyta/1oaHy2QsGk/Tqft GfmCk1E/8Jn3cAsYVPS5ZCFSmxKH4aK9PeGWUC1oCp1mgUazHLCCX2ctyqQOYLdlRioP qZ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=E+CQrTyv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f11-20020a170906494b00b00730a539ac16si660754ejt.982.2022.09.09.10.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 10:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=E+CQrTyv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 619623850417 for ; Fri, 9 Sep 2022 17:26:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 619623850417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662744376; bh=XtqysvV+0feIrrp2qkv2T8g/2vSEkm70iZThsfB+EhM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=E+CQrTyv0eCA1YLAwGI5SyiVERAq13CJsciZkqIbYXYP22HZfMP11slq0VZQtdw27 Wyh0w75HWVfLpQAqQFNi0ITR5qKKUpBQCc3wrrnlT16oCzvZZrFFGZIAJlL5jWHgy2 Y+MXj3T7rah18y7bkE2eA6+pehAjpuUJDPRlew9U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 EA8E33857C4B for ; Fri, 9 Sep 2022 17:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA8E33857C4B Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-606-VpFrLlRsNAa6YhUTlUazHA-1; Fri, 09 Sep 2022 13:24:52 -0400 X-MC-Unique: VpFrLlRsNAa6YhUTlUazHA-1 Received: by mail-qv1-f71.google.com with SMTP id g4-20020ad45424000000b004a9bb302c85so1668519qvt.22 for ; Fri, 09 Sep 2022 10:24:52 -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=XtqysvV+0feIrrp2qkv2T8g/2vSEkm70iZThsfB+EhM=; b=JTu7bnfNL7TTrRTuyWUUX8/LtpFzpotzsWshC+mcys8sln1XfFThljpZp010oabiij ntsYB4+UyG53qW4BA6jOy7xgL289FTxpul/1aBBnKfxC5UOSgQa8JCIZs96L5nqsuSAh 8dFpKNHYHMu6Nr8hrzIzPW9xmbuPunQCkPZ/uFB4Il5k+9EgCt0h+yTXUM/VMeTsxzCP 26TJoVk92eaT1EqEE4WkZz4RVDfloZvXuizHKCqarCz/jUr6tnCAH5IQyI7rV397efJA a+pFlmvy8m/iLbfn5VmKMhYszJjRZaMHPePLJ9bRqOeZa4Itv4bGnQUOu2yS7VKeJq5m bgag== X-Gm-Message-State: ACgBeo3Mso1eqSb42+hEyUAfQHkd4HhM2+8ga7z1cL9XsA5ejx7AHEI7 0ZVhcY+JYnLH/exgQQBFBXUtYSCYApxvRzFyb0eCY2T0fsDI8bQBYI3XF+vQBr61eKDWx+TydrT jH7yOnEqTCSEaNwIfmTCZ23wMgUxnyCmjLoSWGiagW0i0OjKmgeVlCTvAUVlZy2H2wac= X-Received: by 2002:a05:622a:40e:b0:343:7769:5895 with SMTP id n14-20020a05622a040e00b0034377695895mr13861176qtx.467.1662744291611; Fri, 09 Sep 2022 10:24:51 -0700 (PDT) X-Received: by 2002:a05:622a:40e:b0:343:7769:5895 with SMTP id n14-20020a05622a040e00b0034377695895mr13861149qtx.467.1662744291251; Fri, 09 Sep 2022 10:24:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 10:24:50 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/3] libstdc++: Fix return type of empty zip/adjacent_transform [PR106803] Date: Fri, 9 Sep 2022 13:24:46 -0400 Message-Id: <20220909172446.1546805-3-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 X-Spam-Status: No, score=-14.7 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Cc: libstdc++@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743513880201915872?= X-GMAIL-MSGID: =?utf-8?q?1743513880201915872?= Tested on x86_64-pc-linux-gnu, does this series look OK for trunk? PR libstdc++/106803 libstdc++-v3/ChangeLog: * include/std/ranges (views::_ZipTransform::operator()): Fix return type in the empty case. (views::_AdjacentTransform::operator()): Likewise. --- libstdc++-v3/include/std/ranges | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 37ad80ad3de..20eb4e82ac8 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -5071,7 +5071,7 @@ namespace views::__adaptor operator() [[nodiscard]] (_Fp&& __f, _Ts&&... __ts) const { if constexpr (sizeof...(_Ts) == 0) - return views::empty>>; + return views::empty&>>>; else return zip_transform_view(std::forward<_Fp>(__f), std::forward<_Ts>(__ts)...); } @@ -5762,7 +5762,7 @@ namespace views::__adaptor operator() [[nodiscard]] (_Range&& __r, _Fp&& __f) const { if constexpr (_Nm == 0) - return views::empty>; + return zip_transform(std::forward<_Fp>(__f)); else return adjacent_transform_view, decay_t<_Fp>, _Nm> (std::forward<_Range>(__r), std::forward<_Fp>(__f));