From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id CC4853857401; Fri, 4 Jun 2021 23:18:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC4853857401 Received: by mail-wr1-x42b.google.com with SMTP id f2so10739959wri.11; Fri, 04 Jun 2021 16:18:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LpYuhrF5W8N6zR1/5Avh+CMWfyz/bN5qYdfeRbx4BKs=; b=Ie2bf1JiTZ/A0Lz4/fJCK2r+4BlIrxcCjFVUvs+ah4REU9Bp9eE42/bUDptMh8cI49 xg3FD3Z12eE38NVsHadeKABUAeLzExE8QFcVSoMBjDf4nevgcyoeysnF2r5BH2MpXMcu WdA//xo3AexLpQRQJ3rJ1uwf0ntz3xYEiu6UacKlL2K/GnfdP/2QqygSGnfXV3O33IXe occAWBbe2O23f/+t6CWOi9yJuszWFcXwhCjMVKJzP6dbNUI9BY8HE0KNa0ciwB2gKk0W nC2R7koDGiwnTzXBr6NWvYv5b5PKeDhBi1BYP7kf7m+ly7ZlG5NV/eRblahoGF3QGpIb zvgw== X-Gm-Message-State: AOAM531RWnRDdPEcHQlWYpZfjBMHMBA/NtAOJVYNaBwnepTZHo2RaOak lzt28ukEBo8r/7ODC2nDeYMYbQ8iHfBO9fEmk18= X-Google-Smtp-Source: ABdhPJxre3GHzPkN0WlY+B8t7akx/DDtKqUQK5y2heR5FgxKRio13OQDEKEdR2zeFNvEwSjxopiVuMo5krS8H6xy6z4= X-Received: by 2002:a05:6000:1a88:: with SMTP id f8mr3857657wry.185.1622848691993; Fri, 04 Jun 2021 16:18:11 -0700 (PDT) MIME-Version: 1.0 References: <20210604230434.910594-1-rodgert@appliantology.com> In-Reply-To: <20210604230434.910594-1-rodgert@appliantology.com> From: Jonathan Wakely Date: Sat, 5 Jun 2021 00:18:00 +0100 Message-ID: Subject: Re: [PATCH] PR libstdc++/100889: Fix wrong param type in atomic_ref<_Tp*>::wait To: Thomas Rodgers Cc: gcc-patches , "libstdc++" , Thomas Rodgers X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 23:18:14 -0000 On Sat, 5 Jun 2021, 00:05 Thomas Rodgers, wrote: > 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. > That file is testing CTAD, there should be a better place to add this. --- > 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); > -- > 2.26.2 > >