atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++14-extensions" // constexpr ctor body
constexpr atomic(_Tp __i) noexcept : _M_i(__i)
{
-#if __cplusplus >= 201402L && __has_builtin(__builtin_clear_padding)
+#if __has_builtin(__builtin_clear_padding)
if _GLIBCXX17_CONSTEXPR (__atomic_impl::__maybe_has_padding<_Tp>())
if (!std::__is_constant_evaluated())
__builtin_clear_padding(std::__addressof(_M_i));
#endif
}
+#pragma GCC diagnostic pop
operator _Tp() const noexcept
{ return load(); }
-// { dg-do run { target c++20 } }
+// { dg-do run { target c++11 } }
// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
// { dg-additional-options "-fno-tree-sra" }
std::atomic<T> l(T{1, 2});
std::memcpy(&t, &zp, sizeof(T));
-#if __cplusplus >= 201402L // Remove once PR114865 is fixed
VERIFY( l.compare_exchange_strong(t, d) );
-#endif
std::atomic<T>* h = new std::atomic<T>(T{1, 2});
std::memcpy(&t, &zp, sizeof(T));
-#if __cplusplus >= 201402L // Remove once PR114865 is fixed
VERIFY( h->compare_exchange_strong(t, d) );
-#endif
delete h;
constexpr std::atomic<T> cl(T{1, 2});