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: 1676164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=kItXwTe0; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MPNF02x2Bz1yp6 for ; Sat, 10 Sep 2022 03:25:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B20453851176 for ; Fri, 9 Sep 2022 17:25:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B20453851176 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662744349; 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=kItXwTe02S0gvDo7mYZcodblIYtfoRMtEekEF9pdPvNSsKmXlU9OFi/SEFmtTXcyF oQHuOd/KIdTZK64OfjxT5I7HuR9rSq6//wboPP+0jIpw6klBITLWDJVBQFiqPMD7uT fSCWFRczu0niRfGbaCZGsQ8tYjrexVGXEW0ncp6o= 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-Google-Smtp-Source: AA6agR6bjZ9bVgW2aOTlXetAU34KjtWxdRYcVJgVDOyDjJunnwmgwsGC8QMxeEm3VyYyJ5geOBGFsg== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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));