llvm.org GIT mirror llvm / e172bc7
[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 Jordan Rose 4 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
4444 Mask = static_cast(-1) << Bits
4545 };
4646
47 static constexpr const struct RawValueTag {} RawValue = RawValueTag();
47 struct RawValueTag {
48 explicit RawValueTag() = default;
49 };
4850
4951 friend class PointerLikeTypeTraits;
5052
8587 return reinterpret_cast(P.Value);
8688 }
8789 static inline T getFromVoidPointer(void *P) {
88 return T(reinterpret_cast(P), T::RawValue);
90 return T(reinterpret_cast(P), typename T::RawValueTag());
8991 }
9092 static inline T getFromVoidPointer(const void *P) {
91 return T(reinterpret_cast(P), T::RawValue);
93 return T(reinterpret_cast(P), typename T::RawValueTag());
9294 }
9395
9496 enum { NumLowBitsAvailable = T::Shift };