From patchwork Wed Jul 24 16:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1964370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ee8g6laC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTfRs3ljmz1ybY for ; Thu, 25 Jul 2024 02:22:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A55E385C6C6 for ; Wed, 24 Jul 2024 16:22:14 +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.129.124]) by sourceware.org (Postfix) with ESMTP id 623573858C56 for ; Wed, 24 Jul 2024 16:21:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 623573858C56 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 623573858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721838110; cv=none; b=gI6Il7zB3+p9HFYXWHbD5jPsyuFzD65X0mjJoDbih9NFXr0gmy6XGT/VYtDzh10lWn4o2K2qIW3hHIpfqa9nRHh4O+7GN3h7IylnNiFZKMLMXELuYGUc6fOrFzekCP4QJcTbjTutgNQS6hfB23ASvWwPFfIoYqo7UNw6rDyEz8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721838110; c=relaxed/simple; bh=fo/WqxB9lqfjMf3YdfzkA7OvmDCUiVN/B2juv7FLU1I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q/yiDt9t+G+5vP/QBVxcoQ7c5713P5nn2mkXejCysZjshPA1rFoRZHwpCBzyKgtXc2MFmeblXtcQCGqLvcq0q6UyHbT/sXpCPRKlMdsdimUL8KEComam77AalntCfAV6uXn3n3RuQDARAy1GbbhYDzp4rH8IfF0JIqLJYYCOdQA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721838109; 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: in-reply-to:in-reply-to:references:references; bh=D2XiKk/kWldMJP6bFUq4MXP+6VLp/2uL8h2SR/JPSQ8=; b=ee8g6laC+Sr42QUz33B4pz4yquFUUKlGer+u52nlXLSGd7oCENqwCn1z1L5ecSlwoq5Apu opYHwLb0bDDZ9+fV9hP66HE6quPyOrGcUbIEHdeETQMax6X0Sfw8ql8HmM2//j1iIxRhvW QCl6qVWGoKSJL5vzgHJB4swdOd3FvUI= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-WNTNyeQEP4GunbSUm6yPvQ-1; Wed, 24 Jul 2024 12:21:45 -0400 X-MC-Unique: WNTNyeQEP4GunbSUm6yPvQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C42291955D4E; Wed, 24 Jul 2024 16:21:43 +0000 (UTC) Received: from localhost (unknown [10.42.28.14]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E95B61955D42; Wed, 24 Jul 2024 16:21:42 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed 2/2] libstdc++: Fix and for -std=gnu++14 -fconcepts [PR116070] Date: Wed, 24 Jul 2024 17:20:58 +0100 Message-ID: <20240724162133.3934124-2-jwakely@redhat.com> In-Reply-To: <20240724162133.3934124-1-jwakely@redhat.com> References: <20240724162133.3934124-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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 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~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. Backports to follow after the 14.2 release. -- >8 -- This questionable combination of flags causes a number of errors. The ones in the rvalue stream overloads need to be fixed in the gcc-14 branch so I'm committing it separately to simplify backporting. libstdc++-v3/ChangeLog: PR libstdc++/116070 * include/std/istream: Check feature test macro before using is_class_v and is_same_v. * include/std/ostream: 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 11d51d3e666..a2b207dae78 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_concepts >= 201907L +#if __cpp_concepts >= 201907L && __glibcxx_type_trait_variable_templates 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 8a21758d0a3..12be6c4fd17 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -768,7 +768,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _GLIBCXX_RESOLVE_LIB_DEFECTS // 1203. More useful rvalue stream insertion -#if __cpp_concepts >= 201907L +#if __cpp_concepts >= 201907L && __glibcxx_type_trait_variable_templates // Use concepts if possible because they're cheaper to evaluate. template concept __derived_from_ios_base = is_class_v<_Tp>