// { dg-do compile { target c++20 } } // { dg-add-options no_pch } // { dg-require-atomic-cmpxchg-word "PR libstdc++/114103" } #include #ifndef __cpp_lib_atomic_lock_free_type_aliases # error "Feature test macro for lock-free type aliases is missing in " #elif __cpp_lib_atomic_lock_free_type_aliases != 201907L # error "Feature test macro for lock-free type aliases has wrong value in " #endif template constexpr bool is_atomic_specialization = false; template constexpr bool is_atomic_specialization> = true; // The type aliases atomic_signed_lock_free and atomic_unsigned_lock_free // name specializations of atomic static_assert( is_atomic_specialization ); static_assert( is_atomic_specialization ); #include // ... whose template arguments are integral types, static_assert( std::is_integral_v ); static_assert( std::is_integral_v ); // ... respectively signed and unsigned, static_assert( std::is_signed_v ); static_assert( std::is_unsigned_v ); // and whose is_always_lock_free property is true. static_assert( std::atomic_signed_lock_free::is_always_lock_free ); static_assert( std::atomic_unsigned_lock_free::is_always_lock_free );