<div dir="ltr">Ptr member of ManagedStaticBase is now atomic.<div>In ManagedStaticBase::RegisterManagedStatic we have such code:<br></div><div><br></div><div><div>      void *Tmp = Creator();</div><div><br></div><div>      Ptr.store(Tmp, std::memory_order_release);</div><div>      DeleterFn = Deleter;</div><div>      </div><div>      // Add to list of managed statics.</div><div>      Next = StaticList;</div><div>      StaticList = this;</div></div><div><br></div><div><br></div><div>StaticList is not atomic and not guarded by any fence.</div><div>The same applies to the members DeleterFn and Next.</div><div><br></div><div>Doesn't it seem reasonable to change the code to</div><div><br></div><div><div>      DeleterFn = Deleter;</div><div>      </div><div>      // Add to list of managed statics.</div><div>      Next = StaticList;</div><div>      StaticList = this;</div></div><div>      Ptr.store(Tmp, std::memory_order_release);</div></div>