git: eb9ef9d7dfa1 - stable/13 - Merge commit cb7a03b41fff from llvm git (by Nikolas Klauser):

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Sat, 30 Nov 2024 20:12:45 UTC
The branch stable/13 has been updated by jhb:

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

commit eb9ef9d7dfa1d8ef2a74d03cdf7169edd90ec83a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-08-05 19:19:30 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-30 19:11:03 +0000

    Merge commit cb7a03b41fff from llvm git (by Nikolas Klauser):
    
         [libc++] Fix failures with GCC 14 (#92663)
    
        Fixes #91831
    
    Reviewed by:    dim
    Differential Revision:  https://reviews.freebsd.org/D46003
    
    (cherry picked from commit 9bc300465e48e19d794d88d0c158a2adb92c7197)
---
 contrib/llvm-project/libcxx/include/__string/constexpr_c_functions.h | 2 +-
 contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h   | 5 +++++
 contrib/llvm-project/libcxx/include/bitset                           | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/llvm-project/libcxx/include/__string/constexpr_c_functions.h b/contrib/llvm-project/libcxx/include/__string/constexpr_c_functions.h
index 198f0f5e6809..46ad388ec2ea 100644
--- a/contrib/llvm-project/libcxx/include/__string/constexpr_c_functions.h
+++ b/contrib/llvm-project/libcxx/include/__string/constexpr_c_functions.h
@@ -108,7 +108,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n
     }
     return true;
   } else {
-    return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
+    return ::__builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
   }
 }
 
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h
index 54390a1939f7..1048f67055a2 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h
@@ -23,8 +23,13 @@ struct remove_pointer {
   using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
 };
 
+#  ifdef _LIBCPP_COMPILER_GCC
+template <class _Tp>
+using __remove_pointer_t = typename remove_pointer<_Tp>::type;
+#  else
 template <class _Tp>
 using __remove_pointer_t = __remove_pointer(_Tp);
+#  endif
 #else
 // clang-format off
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer                      {typedef _LIBCPP_NODEBUG _Tp type;};
diff --git a/contrib/llvm-project/libcxx/include/bitset b/contrib/llvm-project/libcxx/include/bitset
index 308c58995dc3..5ea48d491303 100644
--- a/contrib/llvm-project/libcxx/include/bitset
+++ b/contrib/llvm-project/libcxx/include/bitset
@@ -376,8 +376,11 @@ template <size_t _N_words, size_t _Size>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long
 __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
   unsigned long long __r = __first_[0];
+  _LIBCPP_DIAGNOSTIC_PUSH
+  _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
   for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
     __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
+  _LIBCPP_DIAGNOSTIC_POP
   return __r;
 }