From c3f86a302f5cfd68a2ad760f009c801857d110b6 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 18 Feb 2016 22:03:23 +0000 Subject: [PATCH] [ADT] Be less clever when using a nonce type for disambiguation. Old compilers don't like constexpr, but we're only going to use this in one place anyway: this file. Everyone else should go through PointerLikeTypeTraits. Update to r261259. llvm-svn: 261268 --- llvm/include/llvm/ADT/PointerEmbeddedInt.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ADT/PointerEmbeddedInt.h b/llvm/include/llvm/ADT/PointerEmbeddedInt.h index 546597f4577a..2279d43405fa 100644 --- a/llvm/include/llvm/ADT/PointerEmbeddedInt.h +++ b/llvm/include/llvm/ADT/PointerEmbeddedInt.h @@ -45,7 +45,9 @@ class PointerEmbeddedInt { Mask = static_cast(-1) << Bits }; - static constexpr const struct RawValueTag {} RawValue = RawValueTag(); + struct RawValueTag { + explicit RawValueTag() = default; + }; friend class PointerLikeTypeTraits; @@ -86,10 +88,10 @@ public: return reinterpret_cast(P.Value); } static inline T getFromVoidPointer(void *P) { - return T(reinterpret_cast(P), T::RawValue); + return T(reinterpret_cast(P), typename T::RawValueTag()); } static inline T getFromVoidPointer(const void *P) { - return T(reinterpret_cast(P), T::RawValue); + return T(reinterpret_cast(P), typename T::RawValueTag()); } enum { NumLowBitsAvailable = T::Shift };