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.

llvm-svn: 337588
This commit is contained in:
Zachary Turner 2018-07-20 17:50:53 +00:00
parent fa07bb646c
commit a219bae1b7
1 changed files with 4 additions and 1 deletions

View 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;