Bug in clang thread_local initialization
When you find that a compiler causes runtime behavior which you are relatively certain is incorrect; and another popular compiler does not cause that same behavior - that is sufficient, IMHO, in order to file a bug against said compiler.
As @SamVarshavchik suggestions, you:
- Visit LLVM's bug tracker
- Create an account if you don't have one
- Look for duplicates (e.g. using the term "thread-local")
- If you don't find one - you file a bug
I've done just that, so now we have bug 42111.
At worst - it'll be marked as a dupe.
edit: It was not a dupe, and has just now (June 5th 2019) been fixed.