[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
This commit is contained in:
Jordan Rose 2016-02-18 22:03:23 +00:00
parent a35f7d383f
commit c3f86a302f
1 changed files with 5 additions and 3 deletions

View File

@ -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 };