[libcxx-commits] [libcxx] [libc++] Don't use incomplete remove_pointer builtin for GCC (PR #91838)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 10 21:16:11 PDT 2024


https://github.com/Chilledheart created https://github.com/llvm/llvm-project/pull/91838

Gcc's remove_pointer builtin is added in 14.1 release but the implementation is incomplete.

see https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/type_traits#L2105 and https://github.com/gcc-mirror/gcc/commit/40dd7a5fe5d.

Fixes #91831.

>From f56d052fd2af7dcdaf3593984efa99e5ca30d817 Mon Sep 17 00:00:00 2001
From: Keeyou <keeyou-cn at outlook.com>
Date: Sat, 11 May 2024 12:10:03 +0800
Subject: [PATCH] [libc++] Don't use incomplete remove_pointer builtin for GCC

Gcc's remove_pointer builtin is added in 14.1 release but the
implementation is incomplete.

see https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/type_traits#L2105
and https://github.com/gcc-mirror/gcc/commit/40dd7a5fe5d.
---
 libcxx/include/__type_traits/remove_pointer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h
index 54390a1939f7d..9b74cd723c7e8 100644
--- a/libcxx/include/__type_traits/remove_pointer.h
+++ b/libcxx/include/__type_traits/remove_pointer.h
@@ -24,7 +24,7 @@ struct remove_pointer {
 };
 
 template <class _Tp>
-using __remove_pointer_t = __remove_pointer(_Tp);
+using __remove_pointer_t = remove_pointer<_Tp>::type;
 #else
 // clang-format off
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer                      {typedef _LIBCPP_NODEBUG _Tp type;};



More information about the libcxx-commits mailing list