From: Zachary Turner Date: Fri, 20 Jul 2018 17:50:53 +0000 (+0000) Subject: Fix linker failure with Any. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32922e691b83763586f0e98d79367819518ce994;p=llvm Fix linker failure with Any. This is due to a difference in MS ABI which is why I didn't see it locally. The included fix should work on all compilers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337588 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/Any.h b/include/llvm/ADT/Any.h index 2be15bb1d88..c64c3998754 100644 --- a/include/llvm/ADT/Any.h +++ b/include/llvm/ADT/Any.h @@ -25,7 +25,7 @@ namespace llvm { class Any { - template struct TypeId { static const char Id = 0; }; + template struct TypeId { static const char Id; }; struct StorageBase { virtual ~StorageBase() = default; @@ -99,6 +99,9 @@ private: std::unique_ptr Storage; }; +template const char Any::TypeId::Id = 0; + + template bool any_isa(const Any &Value) { if (!Value.Storage) return false;