]> granicus.if.org Git - llvm/commitdiff
Use the same tag type across all PointerLikeTypeTraits specializations
authorReid Kleckner <rnk@google.com>
Mon, 20 Jun 2016 23:50:21 +0000 (23:50 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 20 Jun 2016 23:50:21 +0000 (23:50 +0000)
Works around a bug (PR28216) in Clang's MS mangling of templates with
partial specializations.

This mismatch was introduced in about six months ago in r256656.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273223 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PointerLikeTypeTraits.h

index c12d237b2796a015633305d789240850c95ebf51..96cdaed142c2675fae997eeda2f6f3545ff600e3 100644 (file)
@@ -37,7 +37,8 @@ template <> struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
 }
 
 // Provide PointerLikeTypeTraits for non-cvr pointers.
-template <typename T> struct PointerLikeTypeTraits<T *> {
+template <typename T> class PointerLikeTypeTraits<T *> {
+public:
   static inline void *getAsVoidPointer(T *P) { return P; }
   static inline T *getFromVoidPointer(void *P) { return static_cast<T *>(P); }
 
@@ -46,7 +47,8 @@ template <typename T> struct PointerLikeTypeTraits<T *> {
   };
 };
 
-template <> struct PointerLikeTypeTraits<void *> {
+template <> class PointerLikeTypeTraits<void *> {
+public:
   static inline void *getAsVoidPointer(void *P) { return P; }
   static inline void *getFromVoidPointer(void *P) { return P; }