https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102177
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 51406 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51406&action=edit gcc12-pr102177.patch Untested patch to remove the warning and just use maximum for success if weaker than failure instead of always seq_cst. On the other side, even current C2X draft has that: The failure argument shall be no stronger than the success argument. requirement. So should we keep the restriction for __atomic_* APIs and just pass maximum from libstdc++ headers?