From patchwork Wed Jan 17 02:40:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 188675 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp685209dye; Tue, 16 Jan 2024 20:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnYJ1D96SOd/8Cd6MSeHRZOm0D2ljsR/PrvYV58EY9B07zqDs0t4TUWGVXD6mCcxqh2wDC X-Received: by 2002:a05:622a:44b:b0:429:c8e2:9075 with SMTP id o11-20020a05622a044b00b00429c8e29075mr10411376qtx.39.1705464920609; Tue, 16 Jan 2024 20:15:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705464920; cv=pass; d=google.com; s=arc-20160816; b=r1babVWQ1+AQQEhpwMg6jt1zJlORWL5c5I5jOb+U8+dc0xCLt4DEizYbVxLoG4w3hl aJiiTFqnwDGqYKk4bnZLObSGy+CHNJfwwcQcCJt7voH4/5hiDmzIKECZBtfADuZ87rjp ATZ0TVjhOiQaJ0gkIua8QOSdU3mAJPmpptNDkrurxBkQcbcmJ3fUVyeGGUFSegXPdjNZ QXcnE2aWju3EzcxvyKf3qabUBzZ1hW0wP6ObHB7rK0Gu5YK0z6Qr1yraJACT1kJPkxhh +j/9TGLAKjq8/CFsdClOF4AsrBf/ekqgJBLKfxpm84zpbEOMIFjyYuMPDDk4rX3yea/s ZmmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=1uFekh2NcudmpRnRLaxxZR5YMomnbQPcZ/VkPTUygAs=; fh=EVSvWd94bH3+6DLHxQIQnUkCnGLOu/mRCJOpcO366zA=; b=Jo1XrmHKgk/V+l+ENLiWki+Fp4678HJ8IcQpHWjrzdiGu8HN/UjhSKbVVF9XNZdfxU 8SBBkgGLORAhW54rHuLNC5Ssm9bUUpMkzIaKerSjPhZheDwH/wkgj6Sv4EC1n45OGLeT Jvh9BQH/0YOxR0+pKoOESRuYi7EDyznFzOBk+XJHTQSd35OfVcnke8vcsTEEvZxIE8F1 8n/So+tC8EhvsoqvZDy/bhM2uqklMDgBaSjfJ79w8bNy+qbN8cKm9GXDvLG41Q4bq7X7 KVWpEVNIApHdYwG8hp7WcsDY0p0Bn+5OYJEdUg4CspuB3gsRMyTTYfWeIRglrj1LErUY NzIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lg8SsP57; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u9-20020a05622a14c900b0042a0b356114si1358789qtx.313.2024.01.16.20.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 20:15:20 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=Lg8SsP57; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE9B6385F009 for ; Wed, 17 Jan 2024 02:41:23 +0000 (GMT) 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 5CBE03858412 for ; Wed, 17 Jan 2024 02:40:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CBE03858412 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5CBE03858412 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705459212; cv=none; b=g74we5c1wyMj+7DI2GtK/Yhi+H4bFIOHafmfZLW6uUi7cXyfUSHqV3ZXQclWsKpj+tcXTj+Fl97hru07Zr94Y6qomQGnsMp3FA2eof9rNzThbJHk7s8CbmeEJOcaUIG08pjyXPKxFEw5zaj0auA8LK59E50vl74IMDoVUvHjuDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705459212; c=relaxed/simple; bh=vs5/aTGi7A1zxlYHzmRjXT12USqcclPwFsgtbcra840=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=alhpaya6YC9DZTvaJE0rZf1Jnepi+bsw/q8qlYl53heeqdfPqxCEs0rHul1AwCReCQ0FDbOw9aVSWv5d7W9jJ/hURz7SXBw7M3aZPjvTITP5egUTWjn2R89/A+sZtpeTvPdWMg1DhP/MiWJbPNNYDXSHkXbBK5MQ0L7lgq/paFs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705459211; 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; bh=1uFekh2NcudmpRnRLaxxZR5YMomnbQPcZ/VkPTUygAs=; b=Lg8SsP576NyUEL7/z4exAQYOGZhnp+fp2teU/8MhTSIR1L/rWyjLLxRlL+BujAyhBT+8Rq k46g6KRNs+EructzU/4MdAbX/cXB3blWLhMHIBgqeZPvwyMDGO7YPHNQ8/OYUXVIU7+bFy 30PSV/zYo70s3Y16cqsYxnx4KULs2KE= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-16-mCKtSOTJMUySsfmoUe52ow-1; Tue, 16 Jan 2024 21:40:07 -0500 X-MC-Unique: mCKtSOTJMUySsfmoUe52ow-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7831ed4bb2aso1481324785a.0 for ; Tue, 16 Jan 2024 18:40:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705459205; x=1706064005; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1uFekh2NcudmpRnRLaxxZR5YMomnbQPcZ/VkPTUygAs=; b=RpAzJ5ufq+2eh4T7JGBP5vPVbuyHAmbxiZLAVpwce1KYiiuOHDxTeizVBGmVU0WpUF s2vyYTvtpr90iYeEa3rU58Zdtai5ZtrP8dEeFVPPIdTSOgVOI+JvzLKJTLNFBuqcCfO5 R9TE1H5D5Q58zWv1dvsspcmwVn7k+UX3GjSzGhhTkOnBCQCx2BnlDfiBVY7KXLZBH2Au vYGO3kRJIdErGKQQkhTZV7EreWk3+lNl6V+rYSR1KHx9HXo3Lr/b3MsJeoOY164Qubg8 uYeg7M5EY6wy0hf0LsZCK3woMKIyMULcsPZ7/FZtKFTV0R52B06v8sEeRU15Tm04xX8l OHmQ== X-Gm-Message-State: AOJu0YxulDBm8E7vG5xFkTSHUDysRrN7Jn0+503bDsGFbQx94r+EH3iJ v1CDn0k8+FU+reRcJ09mCymP05/UcRvhh+hQi1K/QW9zYpeszE5e6RAOO0d8uTwSvKXYG9Zhe2F Flj9mBRhuCpWr3Y3YQqBMNyfWuvkszw+0/Kgc7A35P74WsNdhZsHGHj/CeQ3jtvv4XEzn8RoIkp XWfByvl7I= X-Received: by 2002:a05:620a:4917:b0:783:247b:a6cf with SMTP id vy23-20020a05620a491700b00783247ba6cfmr8570675qkn.9.1705459205014; Tue, 16 Jan 2024 18:40:05 -0800 (PST) X-Received: by 2002:a05:620a:4917:b0:783:247b:a6cf with SMTP id vy23-20020a05620a491700b00783247ba6cfmr8570663qkn.9.1705459204749; Tue, 16 Jan 2024 18:40:04 -0800 (PST) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id e9-20020a05620a208900b007833c4dddfdsm4125534qka.53.2024.01.16.18.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 18:40:04 -0800 (PST) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka Subject: [PATCH 1/2] libstdc++/tuple: Guard P2321R2 changes with __cpp_lib_ranges_zip Date: Tue, 16 Jan 2024 21:40:01 -0500 Message-ID: <20240117024003.3390758-1-ppalka@redhat.com> X-Mailer: git-send-email 2.43.0.367.g186b115d30 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.8 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_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788309584673655840 X-GMAIL-MSGID: 1788309584673655840 Guard additions from P2321R2 zip with __cpp_lib_ranges_zip instead of __cplusplus > 202020L. libstdc++-v3/ChangeLog: * include/std/tuple [__cplusplus > 202002L]: Guard P2321R2 changes with __cpp_lib_ranges_zip instead. --- libstdc++-v3/include/std/tuple | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 2f6e419ea5b..7a045b3e6a1 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UElements...>& __in) @@ -405,7 +405,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, @@ -449,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::move(_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))); } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr void _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) const @@ -480,7 +480,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Inherited::_M_swap(_M_tail(__in)); } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 constexpr void _M_swap(const _Tuple_impl& __in) const { @@ -549,7 +549,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>& __in) @@ -615,7 +615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, @@ -650,7 +650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)); } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 template constexpr void _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) const @@ -676,7 +676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(_M_head(*this), _M_head(__in)); } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 constexpr void _M_swap(const _Tuple_impl& __in) const { @@ -1775,7 +1775,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION public: _GLIBCXX20_CONSTEXPR void swap(tuple&) noexcept { /* no-op */ } -#if __cplusplus > 202002L +#if __cpp_lib_ranges_zip // >= C++23 constexpr void swap(const tuple&) const noexcept { /* no-op */ } #endif // We need the default since we're going to define no-op