https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122267
--- Comment #5 from Tomasz KamiĆski <tkaminsk at gcc dot gnu.org> --- I have realized that I have unintionally changed atomic_ref<double>::required_aligment from __alignof__(double) is 8 to alignof(double) which is 4. The atomic_ref<double> constructor requires that the object is aligned to required_aligment, so you cannot bind atomic_ref to s.b in your example if it's aligment is not 4.
