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 the whole second condition can be simplified to just D->isIinlineSpecified(). We have to consider plain inline global variables, not just static data members, as in: