[llvm] r261268 - [ADT] Be less clever when using a nonce type for disambiguation.

Jordan Rose via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 14:03:23 PST 2016


Author: jrose
Date: Thu Feb 18 16:03:23 2016
New Revision: 261268

URL: http://llvm.org/viewvc/llvm-project?rev=261268&view=rev
Log:
[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.

Modified:
    llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h

Modified: llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h?rev=261268&r1=261267&r2=261268&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h Thu Feb 18 16:03:23 2016
@@ -45,7 +45,9 @@ class PointerEmbeddedInt {
     Mask = static_cast<uintptr_t>(-1) << Bits
   };
 
-  static constexpr const struct RawValueTag {} RawValue = RawValueTag();
+  struct RawValueTag {
+    explicit RawValueTag() = default;
+  };
 
   friend class PointerLikeTypeTraits<PointerEmbeddedInt>;
 
@@ -86,10 +88,10 @@ public:
     return reinterpret_cast<void *>(P.Value);
   }
   static inline T getFromVoidPointer(void *P) {
-    return T(reinterpret_cast<uintptr_t>(P), T::RawValue);
+    return T(reinterpret_cast<uintptr_t>(P), typename T::RawValueTag());
   }
   static inline T getFromVoidPointer(const void *P) {
-    return T(reinterpret_cast<uintptr_t>(P), T::RawValue);
+    return T(reinterpret_cast<uintptr_t>(P), typename T::RawValueTag());
   }
 
   enum { NumLowBitsAvailable = T::Shift };




More information about the llvm-commits mailing list