From patchwork Thu Nov 16 08:02:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 165735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3081410vqg; Thu, 16 Nov 2023 01:07:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlVIbnm1ASYnUozRMh3EW11Lw2/sOxzOAxGydPV+4i/EquZHZ+s4Q/nZO0iIXedIbHym3v X-Received: by 2002:a05:620a:3705:b0:773:af69:e614 with SMTP id de5-20020a05620a370500b00773af69e614mr9630897qkb.58.1700125634574; Thu, 16 Nov 2023 01:07:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700125634; cv=pass; d=google.com; s=arc-20160816; b=XjcS/y2zssuL9cBJE4TZ+Z0xMD6a6Zl1I5aLNx5Iql+93rftB0KwIzWDBVmRGFTbUu srGtLqcr7y6sneXbdY4GL7s+GctMDxOF6hZiIkYCykCWFdtPf6M09Iup39au1zookFcP QXpettdOGeDNipRcbKDNms5zlSZl1yQQLmYx8bYGehWv3ECmT7MfQGevlYYmPY5rVNFT S8cDQ8aqXY68sddNKl1PpuKLx4BqVZzWt0Isgcg/lLLxyYODTLuOJBgQXaaKY2Gq+zhj 9F+lIXn1OlLmXdXe3GmjtPPAB0+G72tttsthcfvsfZO/OiRd3HFPhGFjFOYZmPum6nHx SnUQ== 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:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=GSZ6TzH7wjg1zfOa5c/DivlWA7DuIX9iMijBIExR//0=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=MjddHpKi+rVyUbS5KZGbltRrlwBP8Xz05phl4ExxBkHCSuVXVb0tv3cD4vOEGaQnJw rjutUmWhKePxqiFQOqukgJfHl4lBZYhNFS1aME9gO+MUc4VV4Ged3X9K25ov2bBMYVct WiT1gxTWM+2uqpO6BG88QXHsg4mlcftKWoMuN83FHSXz7j/lld7EK4JI2NRy2SZgK9VC G2SnkOvAtKliOgjbS4i6aNMkpRB89CzLeOsvdBAgmjhvBf3F0SlFU1d3sfLw2Wdh9Qm4 BoxelItiLJUiJJZ7f+fJUn8dnePDzdIxsTb5BLgCJyMf92SQmjHVZ2vaiLrwksJ40lWS AzTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YUVX6+LX; 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 f20-20020a05620a12f400b0077586a3f934si10682414qkl.582.2023.11.16.01.07.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 01:07:14 -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=YUVX6+LX; 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 7F5A6383BCFC for ; Thu, 16 Nov 2023 08:03:44 +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 48EAE3858C56 for ; Thu, 16 Nov 2023 08:03:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48EAE3858C56 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 48EAE3858C56 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=1700121799; cv=none; b=wn43UFL/ovE5yJz8aSQtrb47L6ni1qFeSQlzLteI/7HsWl4ZbhKdjlMYhQ7Si5kV2m+GXZNXYGlKokpj9GlNwaM4DIC23T9SUlSjmbeYKUmivf7LvxpBuprgab/RJMFCvK/3kv2BR/jdGLkNIZGu+lo/LLysABtGI+9yK2B3fBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700121799; c=relaxed/simple; bh=o9UcXj31D4MrNZo9b64vip4dZe48vdF/bOIzlNzs2Zc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Mx7fnvW3cQNlwnaPWw7LyOWtdnci5oyaMPVvseeeJVr3FjcN8m9s4pt/l9XTZZYOkfaSrqKN0EzFVVeaMEWBUrtlPY6HHa7JE9+gahbPzqW+NrSonpUvPgcMZSOuSPhyubdqkj4xILePZjyaFDDjXFQrjgqdPfII42cOtERIkVA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700121797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GSZ6TzH7wjg1zfOa5c/DivlWA7DuIX9iMijBIExR//0=; b=YUVX6+LXE+ooX9MjeAplhYA3N3sr0i2zEEp7voNe0aQzTFYF0kvH1A4lowvSt4SAQXdCZt YFfL77FD3olCVsEUKH40/Lg+9b8WQlcu7ex3ExkEgXESvP6u5vx84LCc2xrxPqiDa2alHY QvmIklT4FTtjd/OBriP2zsebelzAH8c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-wGLwk755O9uK22PwAvCkvw-1; Thu, 16 Nov 2023 03:03:15 -0500 X-MC-Unique: wGLwk755O9uK22PwAvCkvw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BD28811E8D; Thu, 16 Nov 2023 08:03:15 +0000 (UTC) Received: from localhost (unknown [10.42.28.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 174212026D6E; Thu, 16 Nov 2023 08:03:14 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed 1/2] libstdc++: Adjust feature test in and Date: Thu, 16 Nov 2023 08:02:20 +0000 Message-ID: <20231116080314.1218556-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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, 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 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: 1782710937474886535 X-GMAIL-MSGID: 1782710937474886535 Tested x86_64-linux. Pushed to trunk. -- >8 -- We don't need any library concepts to define the constraints for rvalue stream overloads, only compiler support. So change the test from using __cpp_lib_concepts to __cpp_concepts >= 201907L. libstdc++-v3/ChangeLog: * include/std/istream (__rvalue_stream_extraction_t): Test __cpp_concepts instead of __cpp_lib_concepts. * include/std/ostream (__derived_from_ios_base): Likewise. (__rvalue_stream_insertion_t): Likewise. --- libstdc++-v3/include/std/istream | 2 +- libstdc++-v3/include/std/ostream | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index 25d36973f4b..c2b30b75957 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -1069,7 +1069,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 2328. Rvalue stream extraction should use perfect forwarding // 1203. More useful rvalue stream insertion -#if __cpp_lib_concepts +#if __cpp_concepts >= 201907L template requires __derived_from_ios_base<_Is> && requires (_Is& __is, _Tp&& __t) { __is >> std::forward<_Tp>(__t); } diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index 5f973fa11ed..1de1c1bd359 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -763,7 +763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _GLIBCXX_RESOLVE_LIB_DEFECTS // 1203. More useful rvalue stream insertion -#if __cpp_lib_concepts +#if __cpp_concepts >= 201907L // Use concepts if possible because they're cheaper to evaluate. template concept __derived_from_ios_base = is_class_v<_Tp>