This patch fixes http://llvm.org/PR28954 using the init_priority attribute. All supported compilers accept this attribute, including clang-cl.
I'm only putting this up for review because IDK how to write a test for it.
Can anybody suggest a way to test this?