Fix linker failure with Any.
authorZachary Turner <zturner@google.com>
Fri, 20 Jul 2018 17:50:53 +0000 (17:50 +0000)
committerZachary Turner <zturner@google.com>
Fri, 20 Jul 2018 17:50:53 +0000 (17:50 +0000)
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.

llvm-svn: 337588

llvm/include/llvm/ADT/Any.h

index 2be15bb..c64c399 100644 (file)
@@ -25,7 +25,7 @@
 namespace llvm {
 
 class Any {
-  template <typename T> struct TypeId { static const char Id = 0; };
+  template <typename T> struct TypeId { static const char Id; };
 
   struct StorageBase {
     virtual ~StorageBase() = default;
@@ -99,6 +99,9 @@ private:
   std::unique_ptr<StorageBase> Storage;
 };
 
+template <typename T> const char Any::TypeId<T>::Id = 0;
+
+
 template <typename T> bool any_isa(const Any &Value) {
   if (!Value.Storage)
     return false;