https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- Clang and EDG agree with GCC here. I think your code is ill-formed due to [temp.constr.atomic] p3: "If, at different points in the program, the satisfaction result is different for identical atomic constraints and template arguments, the program is ill-formed, no diagnostic required."