From: Reid Kleckner Date: Mon, 20 Jun 2016 23:50:21 +0000 (+0000) Subject: Use the same tag type across all PointerLikeTypeTraits specializations X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=812340ed7d4bc14cead1be30153f6ab158a1d066;p=llvm Use the same tag type across all PointerLikeTypeTraits specializations 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 --- diff --git a/include/llvm/Support/PointerLikeTypeTraits.h b/include/llvm/Support/PointerLikeTypeTraits.h index c12d237b279..96cdaed142c 100644 --- a/include/llvm/Support/PointerLikeTypeTraits.h +++ b/include/llvm/Support/PointerLikeTypeTraits.h @@ -37,7 +37,8 @@ template <> struct ConstantLog2<1> : std::integral_constant {}; } // Provide PointerLikeTypeTraits for non-cvr pointers. -template struct PointerLikeTypeTraits { +template class PointerLikeTypeTraits { +public: static inline void *getAsVoidPointer(T *P) { return P; } static inline T *getFromVoidPointer(void *P) { return static_cast(P); } @@ -46,7 +47,8 @@ template struct PointerLikeTypeTraits { }; }; -template <> struct PointerLikeTypeTraits { +template <> class PointerLikeTypeTraits { +public: static inline void *getAsVoidPointer(void *P) { return P; } static inline void *getFromVoidPointer(void *P) { return P; }