git: bfc6e56f6327 - main - Merge commit 81b20e110b3f from llvm git (by Roland McGrath):

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 27 Jan 2026 18:40:59 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=bfc6e56f6327621171cef4fe29290c63edfc4d9c

commit bfc6e56f6327621171cef4fe29290c63edfc4d9c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-01-27 18:34:58 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-01-27 18:34:58 +0000

    Merge commit 81b20e110b3f from llvm git (by Roland McGrath):
    
        [libc++] Work around new GCC 15 type_traits builtins that can't be
        used as Clang's can (#137871)
    
        GCC 15 has added builtins for various C++ type traits that Clang
        already had.  Since `__has_builtin(...)` now finds these, the #if
        branches previously only used for Clang are now used for GCC 15.
        However, GCC 15 requires that these builtins only be used in type
        aliases, not in template aliases.
    
        For now, just don't use the `__has_builtin(...)` branches under newer
        GCC versions, so both 14 and 15 work during the transition.  This
        can be cleaned up later to use all the GCC 15 builtins available.
    
        Fixed: #137704
        Fixed: #117319
    
    Reviewed by:    dim
    Differential Revision:  https://reviews.freebsd.org/D54865
---
 .../llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h    | 2 +-
 contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h         | 2 +-
 .../llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h    | 2 +-
 contrib/llvm-project/libcxx/include/__type_traits/decay.h               | 2 +-
 contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h  | 2 +-
 contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h       | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
index a633e3904532..f583b4328830 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -18,7 +18,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__add_lvalue_reference)
+#if __has_builtin(__add_lvalue_reference) && !defined(_LIBCPP_COMPILER_GCC)
 
 template <class _Tp>
 using __add_lvalue_reference_t = __add_lvalue_reference(_Tp);
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h
index 5aac7d5cfa90..8f85ece33d6a 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h
@@ -20,7 +20,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer)
+#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer) && !defined(_LIBCPP_COMPILER_GCC)
 
 template <class _Tp>
 using __add_pointer_t = __add_pointer(_Tp);
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
index a54aae7ec8de..e5dc920e6a44 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
@@ -18,7 +18,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__add_rvalue_reference)
+#if __has_builtin(__add_rvalue_reference) && !defined(_LIBCPP_COMPILER_GCC)
 
 template <class _Tp>
 using __add_rvalue_reference_t = __add_rvalue_reference(_Tp);
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/decay.h b/contrib/llvm-project/libcxx/include/__type_traits/decay.h
index 7412044f9317..861dc2eb10d0 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/decay.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/decay.h
@@ -25,7 +25,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__decay)
+#if __has_builtin(__decay) && !defined(_LIBCPP_COMPILER_GCC)
 template <class _Tp>
 using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
 
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
index d5373b51f522..a27e3bb48038 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
@@ -18,7 +18,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__remove_all_extents)
+#if __has_builtin(__remove_all_extents) && !defined(_LIBCPP_COMPILER_GCC)
 template <class _Tp>
 struct remove_all_extents {
   using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp);
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h
index fe37b5c7266c..767331e102ad 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h
@@ -18,7 +18,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__remove_extent)
+#if __has_builtin(__remove_extent) && !defined(_LIBCPP_COMPILER_GCC)
 template <class _Tp>
 struct remove_extent {
   using type _LIBCPP_NODEBUG = __remove_extent(_Tp);