mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <jwakely@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.
- Loading branch information
Showing
2 changed files
with
25 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters