re PR libstdc++/89641 (std::atomic<T> no longer works)
authorJakub Jelinek <jakub@redhat.com>
Mon, 11 Mar 2019 11:49:13 +0000 (12:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 11 Mar 2019 11:49:13 +0000 (12:49 +0100)
PR libstdc++/89641
* include/std/atomic (atomic<T>::store, atomic<T>::load,
atomic<T>::exchange, atomic<T>::compare_exchange_weak,
atomic<T>::compare_exchange_strong): Cast __m or __s and __f to int.
* include/bits/atomic_base.h (__atomic_base<T>::operator++,
__atomic_base<T>::operator--, __atomic_base<T>::operator+=,
__atomic_base<T>::operator-=, __atomic_base<T>::operator&=,
__atomic_base<T>::operator|=, __atomic_base<T>::operator^=,
__atomic_base<T*>::operator++, __atomic_base<T*>::operator--,
__atomic_base<T*>::operator+=, __atomic_base<T*>::operator-=): Cast
memory_order_seq_cst to int.

From-SVN: r269582

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/std/atomic

index 7da25945a8c8adaabe4a5012968cfd3786551f51..cee2c9d1d572aa92646e60b5e791893d57b937a4 100644 (file)
@@ -1,3 +1,17 @@
+2019-03-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libstdc++/89641
+       * include/std/atomic (atomic<T>::store, atomic<T>::load,
+       atomic<T>::exchange, atomic<T>::compare_exchange_weak,
+       atomic<T>::compare_exchange_strong): Cast __m or __s and __f to int.
+       * include/bits/atomic_base.h (__atomic_base<T>::operator++,
+       __atomic_base<T>::operator--, __atomic_base<T>::operator+=,
+       __atomic_base<T>::operator-=, __atomic_base<T>::operator&=,
+       __atomic_base<T>::operator|=, __atomic_base<T>::operator^=,
+       __atomic_base<T*>::operator++, __atomic_base<T*>::operator--,
+       __atomic_base<T*>::operator+=, __atomic_base<T*>::operator-=): Cast
+       memory_order_seq_cst to int.
+
 2019-03-08  Jonathan Wakely  <jwakely@redhat.com>
 
        * doc/xml/manual/using.xml: Use link element instead of xref.
index 6c1703aa11aadf87623168be1bb1ced3830ef244..e30caef91bf1e08b86eaadba0dec4fd86ba9fc04 100644 (file)
@@ -316,59 +316,59 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       __int_type
       operator++() noexcept
-      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+      { return __atomic_add_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
 
       __int_type
       operator++() volatile noexcept
-      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+      { return __atomic_add_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
 
       __int_type
       operator--() noexcept
-      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+      { return __atomic_sub_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
 
       __int_type
       operator--() volatile noexcept
-      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+      { return __atomic_sub_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
 
       __int_type
       operator+=(__int_type __i) noexcept
-      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_add_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator+=(__int_type __i) volatile noexcept
-      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_add_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator-=(__int_type __i) noexcept
-      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_sub_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator-=(__int_type __i) volatile noexcept
-      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_sub_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator&=(__int_type __i) noexcept
-      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_and_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator&=(__int_type __i) volatile noexcept
-      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_and_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator|=(__int_type __i) noexcept
-      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_or_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator|=(__int_type __i) volatile noexcept
-      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_or_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator^=(__int_type __i) noexcept
-      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_xor_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       __int_type
       operator^=(__int_type __i) volatile noexcept
-      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+      { return __atomic_xor_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
 
       bool
       is_lock_free() const noexcept
@@ -652,42 +652,42 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __pointer_type
       operator++() noexcept
       { return __atomic_add_fetch(&_M_p, _M_type_size(1),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator++() volatile noexcept
       { return __atomic_add_fetch(&_M_p, _M_type_size(1),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator--() noexcept
       { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator--() volatile noexcept
       { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator+=(ptrdiff_t __d) noexcept
       { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator+=(ptrdiff_t __d) volatile noexcept
       { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator-=(ptrdiff_t __d) noexcept
       { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       __pointer_type
       operator-=(ptrdiff_t __d) volatile noexcept
       { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
-                                 memory_order_seq_cst); }
+                                 int(memory_order_seq_cst)); }
 
       bool
       is_lock_free() const noexcept
index 7acc2462bfb5074a8d7cbc3d5915f2db4baa88ab..699431e97271959380620455411dd1a90b8746b1 100644 (file)
@@ -240,18 +240,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       void
       store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
-      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), int(__m)); }
 
       void
       store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept
-      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), int(__m)); }
 
       _Tp
       load(memory_order __m = memory_order_seq_cst) const noexcept
       {
        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
        _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
-       __atomic_load(std::__addressof(_M_i), __ptr, __m);
+       __atomic_load(std::__addressof(_M_i), __ptr, int(__m));
        return *__ptr;
       }
 
@@ -260,7 +260,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
         alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
        _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
-       __atomic_load(std::__addressof(_M_i), __ptr, __m);
+       __atomic_load(std::__addressof(_M_i), __ptr, int(__m));
        return *__ptr;
       }
 
@@ -270,7 +270,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
         alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
        _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
        __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
-                         __ptr, __m);
+                         __ptr, int(__m));
        return *__ptr;
       }
 
@@ -281,7 +281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
         alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
        _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
        __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
-                         __ptr, __m);
+                         __ptr, int(__m));
        return *__ptr;
       }
 
@@ -292,7 +292,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return __atomic_compare_exchange(std::__addressof(_M_i),
                                         std::__addressof(__e),
                                         std::__addressof(__i),
-                                        true, __s, __f);
+                                        true, int(__s), int(__f));
       }
 
       bool
@@ -302,7 +302,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return __atomic_compare_exchange(std::__addressof(_M_i),
                                         std::__addressof(__e),
                                         std::__addressof(__i),
-                                        true, __s, __f);
+                                        true, int(__s), int(__f));
       }
 
       bool
@@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return __atomic_compare_exchange(std::__addressof(_M_i),
                                         std::__addressof(__e),
                                         std::__addressof(__i),
-                                        false, __s, __f);
+                                        false, int(__s), int(__f));
       }
 
       bool
@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return __atomic_compare_exchange(std::__addressof(_M_i),
                                         std::__addressof(__e),
                                         std::__addressof(__i),
-                                        false, __s, __f);
+                                        false, int(__s), int(__f));
       }
 
       bool