Bummer. Turns out, thread-safe initialization has been enabled by default in both GCC and LLVM for a while. If you have solid reasons to disable it (or fancy a little shooting-yourself-in-the-foot), there’s the-fno-threadsafe-staticscompiler switch, which does the trick: g++ main.cpp ...