]> granicus.if.org Git - llvm/commitdiff
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337588 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Any.h

index 2be15bb1d8897fb8c46a7aedad7addc3236d58ae..c64c39987542dc27ec0382fc45c600e418bf76f2 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;