[llvm] r273223 - Use the same tag type across all PointerLikeTypeTraits specializations

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 23:44:47 PDT 2016


On Tue, Jun 21, 2016 at 2:57 AM Reid Kleckner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rnk
> Date: Mon Jun 20 18:50:21 2016
> New Revision: 273223
>
> URL: http://llvm.org/viewvc/llvm-project?rev=273223&view=rev
> Log:
> 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.
>

Thanks.

Also, UGH.

Don't we have a warning to catch this? Can we turn it on if we're going to
have to care?

(I'd much rather not care, but I understand that MS's ABI has made that
impossible?)


>
> Modified:
>     llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h
>
> Modified: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h?rev=273223&r1=273222&r2=273223&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h (original)
> +++ llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Mon Jun 20
> 18:50:21 2016
> @@ -37,7 +37,8 @@ template <> struct ConstantLog2<1> : std
>  }
>
>  // 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 PointerLike
>    };
>  };
>
> -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; }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160621/9167958e/attachment.html>


More information about the llvm-commits mailing list