[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:58 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Keeyou (Chilledheart)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/91838.diff


1 Files Affected:

- (modified) libcxx/include/__type_traits/remove_pointer.h (+1-1) 


``````````diff
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;};

``````````

</details>


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


More information about the libcxx-commits mailing list