On Sat, 18 Sept 2021 at 05:12, Thomas Rodgers <rodg...@appliantology.com> wrote:
> From: Thomas Rodgers <rodg...@twrodgers.com> > > Let's try this one instead. > > Signed-off-by: Thomas Rodgers <trodg...@redhat.com> > If you're doing DCO "Signed-off-by" commits you don't need FSF copyright notices in the new tests. I no longer put any copyright notices in the tests, because it's largely pointless. They're usually not interesting and don't do anything that anybody is going to want to steal to incorporate into non-GPL code. Your new 20_util/shared_ptr/atomic/atomic_shared_ptr.cc is non-trivial, and maybe interesting, but the two that just check feature test macros are not worth putting licence headers and copyright notices on. > libstdc++-v3/ChangeLog: > * acinclude.m4: Update ABI version. > * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Do not match new > _Sp_locker > constructor. > (GLIBCXX_3.4.30): Export _Sp_locker::_M_wait/_M_notify and new > constructor. > * include/bits/shared_ptr_atomic.h: define > __cpp_lib_atomic_shared_ptr > feature test macro. > (_Sp_locker::_Sp_locker(const void*, bool): New constructor. > (_Sp_locker::_M_wait()), _Sp_locker::_M_notify()): New methods. > (_Sp_impl): New type. > (atomic<shared_ptr<_Tp>>): New partial template specialization. > (atomic<weak_ptr<_Tp>>): New partial template specialization. > * include/std/version: define __cpp_lib_atomic_shared_ptr feature > test macro. > * doc/xml/manual/abi.xml: New ABI version. > * src/c++11/Makefile.am: Compile src/c++11/shared_ptr.cc > -std=gnu++20. > * src/c++11/Makefile.in: Regenerate. > * src/c++11/shared_ptr.cc (_Sp_locker::_Sp_locker(const void*, > bool), > _Sp_locker::_M_wait(), _Sp_locker::_M_notify(): Implement. > * testsuite/20_util/shared_ptr/atomic/4.cc: New test. > * testsuite/20_util/shared_ptr/atomic/5.cc: Likewise. > * testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: > Likewise. > * testuite/util/testsuite_abi.cc: New ABI version. > --- > libstdc++-v3/acinclude.m4 | 2 +- > libstdc++-v3/config/abi/pre/gnu.ver | 12 +- > libstdc++-v3/configure | 2 +- > libstdc++-v3/doc/xml/manual/abi.xml | 1 + > libstdc++-v3/include/bits/shared_ptr_atomic.h | 309 ++++++++++++++++++ > libstdc++-v3/include/std/version | 1 + > libstdc++-v3/src/c++11/Makefile.am | 6 + > libstdc++-v3/src/c++11/Makefile.in | 6 + > libstdc++-v3/src/c++11/shared_ptr.cc | 86 ++++- > .../testsuite/20_util/shared_ptr/atomic/4.cc | 28 ++ > .../testsuite/20_util/shared_ptr/atomic/5.cc | 28 ++ > .../shared_ptr/atomic/atomic_shared_ptr.cc | 159 +++++++++ > libstdc++-v3/testsuite/util/testsuite_abi.cc | 3 +- > 13 files changed, 637 insertions(+), 6 deletions(-) > create mode 100644 libstdc++-v3/testsuite/20_util/shared_ptr/atomic/4.cc > create mode 100644 libstdc++-v3/testsuite/20_util/shared_ptr/atomic/5.cc > create mode 100644 > libstdc++-v3/testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc > > [...] > + void > + store(value_type __r, memory_order __o = memory_order_seq_cst) > noexcept > + { _M_impl._M_store(move(__r), __o); } > Every move(x) needs to be qualified as std::move(x) to avoid ADL. > > + > +// { dg-options "-std=gnu++2a" } > +// { dg-do run { target c++2a } } > gnu++20 and c++20 has been OK for a while, there's no need to use the 2a forms. Other than that, the patch looks OK, but I have a modified version based on your patch just using atomic ops, no mutexes, which I'll post shortly.