https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118854
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The bug is in your code. > If I reverse the order of these two statements That is correct. You have an order of initialization issue. BackgroundThread constructor uses Resource:: _pInstance indirectly via the thread.