From patchwork Thu Jul 11 23:14: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: 1959600 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=JUquynRq; 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 4WKrH80cHdz1xqx for ; Fri, 12 Jul 2024 09:17:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6771C3834695 for ; Thu, 11 Jul 2024 23:17:37 +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 143E63836E9A for ; Thu, 11 Jul 2024 23:16:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 143E63836E9A 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 143E63836E9A 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=1720739805; cv=none; b=DKGIf7sTnbYpGxmedWbEsSQBdPePgRst17FZYb6W4GInGor9yOK2bIqBxAPzf4ZFwa2e8sacjDaKmmQqGoDeMl6nSvGXEPNByVK/J4MG2+VGRz8XgjfkVABDiS9lLCTDltFFH5ZieWGL36W08nVSmjZEnGo56ErLF00XsaA/egA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720739805; c=relaxed/simple; bh=2uy+ivO2g8LCcJldLnGMwBEbc3HOnv+EBjhhwhmlqFg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZlioE3/33+gNdBDEHplj72SVgn1J/BFbQPT1k2k7PXyuPdxCHwrIkdoM14s4wB3CtE1CDQ0a2BXJdC5A2EUM5/0vw5sIoWG5MoOM6oYvMWnCE7xkI+rUzWuX85mSSUscjiycr4ebME6lonwsydTtb7pmm6X7cdgcvFTg7m1m8nE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720739801; 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: in-reply-to:in-reply-to:references:references; bh=Jvd1APT1irx2eqb3Ve2GH/mzqWh0qAc4EQRYC7XLMF0=; b=JUquynRqR6A6PhSUomx2iBjRVLy7QVFbVUhjIhdS7RKqn0Tba8OUhPesYX0DNMcdO3TFLN DNonFavoQdKjwZnp1KlBeDqW8miwcFWBRqTi5rXPIpmk4XTrKRM2m4v43Bu84ugYIaCX2+ ZAz2VbNuyM7a3hqOD6nycVAl+JvyaWQ= Received: from mx-prod-mc-03.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-306-nGQ4QzoWOS6h3JPcHQfzkg-1; Thu, 11 Jul 2024 19:16:37 -0400 X-MC-Unique: nGQ4QzoWOS6h3JPcHQfzkg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B31719560AB; Thu, 11 Jul 2024 23:16:35 +0000 (UTC) Received: from localhost (unknown [10.42.28.210]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C937A1955F40; Thu, 11 Jul 2024 23:16:33 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: lebrungrandt@ornl.gov Subject: [committed] libstdc++: the specialization atomic_ref should use the primary template Date: Fri, 12 Jul 2024 00:14:58 +0100 Message-ID: <20240711231632.1263377-1-jwakely@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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~incoming=patchwork.ozlabs.org@gcc.gnu.org On Thu, 23 May 2024 at 00:06, Lebrun-Grandie, Damien wrote: > > See patch attached to this email. Thanks for the patch. Sorry it took a while, but I've now pushed it to trunk, along with the test below. Tested x86_64-linux. Pushed to trunk. -- >8 -- The previous commit changed atomic_ref to not use the integral specialization. This adds a test to verify that change. We can't directly test that the primary template is used, but we can check that the member functions of the integral specializations are not present. libstdc++-v3/ChangeLog: * testsuite/29_atomics/atomic_ref/bool.cc: New test. --- .../testsuite/29_atomics/atomic_ref/bool.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc new file mode 100644 index 00000000000..4702932627e --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc @@ -0,0 +1,15 @@ +// { dg-do compile { target c++20 } } + +#include + +template concept has_and = requires (T& a) { a &= false; }; +template concept has_or = requires (T& a) { a |= false; }; +template concept has_xor = requires (T& a) { a ^= false; }; +template concept has_fetch_add = requires (T& a) { a.fetch_add(true); }; +template concept has_fetch_sub = requires (T& a) { a.fetch_sub(true); }; + +static_assert( not has_and> ); +static_assert( not has_or> ); +static_assert( not has_xor> ); +static_assert( not has_fetch_add> ); +static_assert( not has_fetch_sub> );