https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102177
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:fef3d31bd35f53cbcacaec63b279d38c38b78abe commit r11-9926-gfef3d31bd35f53cbcacaec63b279d38c38b78abe Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Sep 2 15:29:22 2021 +0100 libstdc++: Remove "no stronger" assertion in compare exchange [PR102177] P0418R2 removed some preconditions from std::atomic::compare_exchange_* but we still enforce them via __glibcxx_assert. This removes those assertions. Signed-off-by: Jonathan Wakely <jwak...@redhat.com> libstdc++-v3/ChangeLog: PR c++/102177 * include/bits/atomic_base.h (__is_valid_cmpexch_failure_order): New function to check if a memory order is valid for the failure case of compare exchange operations. (__atomic_base<I>::compare_exchange_weak): Simplify assertions by using __is_valid_cmpexch_failure_order. (__atomic_base<I>::compare_exchange_strong): Likewise. (__atomic_base<P*>::compare_exchange_weak): Likewise. (__atomic_base<P*>::compare_exchange_strong): Likewise. (__atomic_impl::compare_exchange_weak): Add assertion. (__atomic_impl::compare_exchange_strong): Likewise. * include/std/atomic (atomic::compare_exchange_weak): Likewise. (atomic::compare_exchange_strong): Likewise. (cherry picked from commit dba1ab212292839572fda60df00965e094a11252)