[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 22:40:24 PDT 2024


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

>From aa59e038036835329f0766e9e3f447f7c8a8d2a8 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..690a58068dd8c 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 = typename 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