[llvm] r337588 - Fix linker failure with Any.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 20 10:50:53 PDT 2018
Author: zturner
Date: Fri Jul 20 10:50:53 2018
New Revision: 337588
URL: http://llvm.org/viewvc/llvm-project?rev=337588&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/ADT/Any.h
Modified: llvm/trunk/include/llvm/ADT/Any.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Any.h?rev=337588&r1=337587&r2=337588&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Any.h (original)
+++ llvm/trunk/include/llvm/ADT/Any.h Fri Jul 20 10:50:53 2018
@@ -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;
More information about the llvm-commits
mailing list