public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Thomas Rodgers <rodgert@appliantology.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"libstdc++" <libstdc++@gcc.gnu.org>,
	Thomas Rodgers <trodgers@redhat.com>
Subject: Re: [PATCH] PR libstdc++/100889: Fix wrong param type in atomic_ref<_Tp*>::wait
Date: Sat, 5 Jun 2021 00:18:00 +0100	[thread overview]
Message-ID: <CAH6eHdQuPHFGWB8Y86bRbWSOFFimQMxFNLMSO_SRce5NcgZ9WA@mail.gmail.com> (raw)
In-Reply-To: <20210604230434.910594-1-rodgert@appliantology.com>

On Sat, 5 Jun 2021, 00:05 Thomas Rodgers, <rodgert@appliantology.com> 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<decltype(a2), std::atomic_ref<int*>>);
> +  a2.store(nullptr);
>
>    struct X { } x;
>    std::atomic_ref a3(x);
> --
> 2.26.2
>
>

  reply	other threads:[~2021-06-04 23:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 23:04 Thomas Rodgers
2021-06-04 23:18 ` Jonathan Wakely [this message]
2021-06-05  0:44   ` [PATCH] [libstdc++] Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] Thomas Rodgers
2021-06-07 22:02   ` [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] [PR100889] Thomas Rodgers
2021-06-08  0:28     ` [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] Thomas Rodgers
2021-06-08 15:44       ` Jonathan Wakely
2021-06-08 23:03         ` Thomas Rodgers
2021-06-09 14:30           ` Christophe Lyon
2021-06-09 14:52             ` Thomas Rodgers
2021-06-09 15:11               ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdQuPHFGWB8Y86bRbWSOFFimQMxFNLMSO_SRce5NcgZ9WA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=rodgert@appliantology.com \
    --cc=trodgers@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).