From patchwork Fri Jun 4 23:04:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Rodgers X-Patchwork-Id: 1488161 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (4096-bit key; secure) header.d=kolabnow.com header.i=@kolabnow.com header.a=rsa-sha256 header.s=dkim20160331 header.b=4ruY9x87; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fxddn0ngzz9sW4 for ; Sat, 5 Jun 2021 09:05:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EC2D39A2418 for ; Fri, 4 Jun 2021 23:05:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx.kolabnow.com (mx.kolabnow.com [95.128.36.41]) by sourceware.org (Postfix) with ESMTPS id 53A02385782F; Fri, 4 Jun 2021 23:04:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53A02385782F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=appliantology.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=appliantology.com Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 27AD840704; Sat, 5 Jun 2021 01:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20160331; t=1622847884; x=1624662285; bh=jnMM9N5Ljn8HCDdjp/1 DSMPHwSMpqm3uB2sCziwHXPc=; b=4ruY9x87hx0lHuiJo/QdEZwv5SC774057Vq fmjhU9hsaOFlYmJzx/g3y3WYMqd+akOvmDNVR54M69Rbblgk86uMTDKkunvrhvuu sOI9eEbOYpOgArMAt8cyvfZigDmdxo3HdBUPzkDT0YfwPpxWfXpB26etxp5ztn2b 3fwnJXrBQFu5Cem8kX779EsrgyqrTRGui9vl5poJiSlef3B3ft3o9cLIfqIvckJL 0CEEC1NieKpxwkE7PVwbbnYUZYJkJZOe8h7cyIr9QvZhThgvEo5F7Qymjradplhz 6VM+VNZsVXktORPXyieQbN53I7vPhNLQ0z1ybQHTkZtD3FS793854d6NMqZ4/I9Z TMav+EjYHiIrmaZiisJNOaNJcPDpyFnAg0fnAzVDeV3tG1/J9lCTCMmxJpPz8Lw9 Fb1RHaoGFfkMvmM0udQDPX0cUKLbYe7TQD2DWE+G8tbfzhUD9ckrQ1KP/f00YYV2 elH6oRjvOpK58je8SAZa/pO1xnywqzzoV5QuR+g4SQACFSg4cGTPVCs6cRVdlm7I siOHD1NEYoL/zW1IVSusCl6JG+9SJx9vxDy5ZHxqFUMSVDJaP8vIy9nAmgZ805PG i1QCsI1JeL2NOfy1p77mJjpa+EtcxMy/rfcpRV+zAJhNmg0sLolB0pym7mMq62nK 2wrlLV1Y= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Score: -1.899 X-Spam-Level: X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NN2RWY3w8P-o; Sat, 5 Jun 2021 01:04:44 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id D0072404C5; Sat, 5 Jun 2021 01:04:42 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx001.mykolab.com (Postfix) with ESMTPS id B60E0BC5; Sat, 5 Jun 2021 01:04:40 +0200 (CEST) From: Thomas Rodgers To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [PATCH] PR libstdc++/100889: Fix wrong param type in atomic_ref<_Tp*>::wait Date: Fri, 4 Jun 2021 16:04:34 -0700 Message-Id: <20210604230434.910594-1-rodgert@appliantology.com> MIME-Version: 1.0 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Cc: trodgers@redhat.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100889 libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (atomic_ref<_Tp*>::wait): Change parameter type from _Tp to _Tp*. * testsuite/29_atomics/atomic_ref/deduction.cc: Add reproducer case from PR. --- libstdc++-v3/include/bits/atomic_base.h | 2 +- libstdc++-v3/testsuite/29_atomics/atomic_ref/deduction.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 029b8ad65a9..20cf1343c58 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -1870,7 +1870,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cpp_lib_atomic_wait _GLIBCXX_ALWAYS_INLINE void - wait(_Tp __old, memory_order __m = memory_order_seq_cst) const noexcept + wait(_Tp* __old, memory_order __m = memory_order_seq_cst) const noexcept { __atomic_impl::wait(_M_ptr, __old, __m); } // TODO add const volatile overload diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/deduction.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/deduction.cc index 86395b0c2b0..ed46b430f7c 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/deduction.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/deduction.cc @@ -34,6 +34,7 @@ test01() int* p = &i; std::atomic_ref a2(p); static_assert(std::is_same_v>); + a2.store(nullptr); struct X { } x; std::atomic_ref a3(x);