diff --git a/llvm/include/llvm/Support/Registry.h b/llvm/include/llvm/Support/Registry.h index ff9226c39359c..c02f15e5e32b8 100644 --- a/llvm/include/llvm/Support/Registry.h +++ b/llvm/include/llvm/Support/Registry.h @@ -58,8 +58,8 @@ namespace llvm { // declaration causing error C2487 "member of dll interface class may not // be declared with dll interface". // https://developercommunity.visualstudio.com/t/c2487-in-dllexport-class-with-static-members/69878 - static node *Head; - static node *Tail; + static inline node *Head = nullptr; + static inline node *Tail = nullptr; public: /// Node in linked list of entries. @@ -143,19 +143,11 @@ namespace llvm { /// Instantiate a registry class. #define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \ namespace llvm { \ - template \ - typename Registry::node *Registry::Head = nullptr; \ - template \ - typename Registry::node *Registry::Tail = nullptr; \ template class LLVM_ABI_EXPORT Registry; \ } #else #define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \ namespace llvm { \ - template \ - typename Registry::node *Registry::Head = nullptr; \ - template \ - typename Registry::node *Registry::Tail = nullptr; \ template class Registry; \ } #endif