MS only run time problem with inline static data member or inline variable.
An inline static data member's initialize function or inline variable's initialize function gets called multiple time.
To fix this, using template static data member’s initialization method instead.
So that inline static data member or inline variable initialize's function can be put into COMDAT group with global being initialized. And also put inline data in the linker directive. So that the function can be called before main.
The bug is report in:
https://bugs.llvm.org/show_bug.cgi?id=37903
I think this can be simplified by removing the isTemplateInstantiation check and then checking for GVA_DiscardableODR or GVA_StrongODR. That will handle the cases of explicit template instantiation that you have below.
It's up to you if you want to implement the simplification. The current code is correct, I don't believe it's possible to create a GVA_StrongODR global variable with a dynamic initializer without template instantiation (phew).