From e172bc73c692a4f40484fdf2a9ef7188e5dd0123 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261268 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/PointerEmbeddedInt.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/llvm/ADT/PointerEmbeddedInt.h b/include/llvm/ADT/PointerEmbeddedInt.h index 546597f4577..2279d43405f 100644 --- a/include/llvm/ADT/PointerEmbeddedInt.h +++ b/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 }; -- 2.11.0