https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118854
--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #16) > "- both conflicting evaluations are atomic operations (see std::atomic), or" > > They're not. N.B. std::atomic::~atomic() is not an atomic operation, so using std::atomic does not avoid the data race. It avoids data races for loads and stores in different threads, but not races caused by conflicting accesses during the object's destruction. You must stop accessing a global object while it's being destroyed in another thread. I really don't know why this needs to be repeated so many times.