aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project')
-rw-r--r--contrib/llvm-project/libcxx/include/__functional/binary_function.h5
-rw-r--r--contrib/llvm-project/libcxx/include/__functional/unary_function.h5
-rw-r--r--contrib/llvm-project/libcxx/include/__functional/weak_result_type.h2
-rw-r--r--contrib/llvm-project/libcxx/include/__memory/allocator_traits.h2
-rw-r--r--contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h3
-rw-r--r--contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h8
-rw-r--r--contrib/llvm-project/libcxx/include/tuple4
7 files changed, 18 insertions, 11 deletions
diff --git a/contrib/llvm-project/libcxx/include/__functional/binary_function.h b/contrib/llvm-project/libcxx/include/__functional/binary_function.h
index ddee3b170311..18879f65112b 100644
--- a/contrib/llvm-project/libcxx/include/__functional/binary_function.h
+++ b/contrib/llvm-project/libcxx/include/__functional/binary_function.h
@@ -39,11 +39,10 @@ struct __binary_function_keep_layout_base {
};
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Arg1, class _Arg2, class _Result>
using __binary_function = binary_function<_Arg1, _Arg2, _Result>;
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCPP_SUPPRESS_DEPRECATED_POP
#else
template <class _Arg1, class _Arg2, class _Result>
using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
diff --git a/contrib/llvm-project/libcxx/include/__functional/unary_function.h b/contrib/llvm-project/libcxx/include/__functional/unary_function.h
index 69b1bc94220a..d46df2e86fbd 100644
--- a/contrib/llvm-project/libcxx/include/__functional/unary_function.h
+++ b/contrib/llvm-project/libcxx/include/__functional/unary_function.h
@@ -36,11 +36,10 @@ struct __unary_function_keep_layout_base {
};
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Arg, class _Result>
using __unary_function = unary_function<_Arg, _Result>;
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCPP_SUPPRESS_DEPRECATED_POP
#else
template <class _Arg, class _Result>
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
diff --git a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h
index ad7a8395186c..488fec9dac21 100644
--- a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h
+++ b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h
@@ -77,6 +77,7 @@ struct __maybe_derive_from_unary_function // bool is true
template <class _Tp>
struct __maybe_derive_from_unary_function<_Tp, false> {};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
struct __maybe_derive_from_binary_function // bool is true
: public __derives_from_binary_function<_Tp>::type {};
@@ -99,6 +100,7 @@ struct __weak_result_type_imp<_Tp, false>
template <class _Tp>
struct __weak_result_type : public __weak_result_type_imp<_Tp> {};
+_LIBCPP_SUPPRESS_DEPRECATED_POP
// 0 argument case
diff --git a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
index c5fcc89327b8..f3e327edda12 100644
--- a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
+++ b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
@@ -40,6 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp> \
struct NAME<_Tp, __void_t<typename _Tp::PROPERTY > > : true_type {}
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
// __pointer
template <class _Tp,
class _Alloc,
@@ -67,6 +68,7 @@ struct __const_pointer<_Tp, _Ptr, _Alloc, false> {
using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
#endif
};
+_LIBCPP_SUPPRESS_DEPRECATED_POP
// __void_pointer
_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer);
diff --git a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
index 7475ef5cf85d..79cab80dcf73 100644
--- a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
@@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _
__guard.__complete();
std::__allocator_destroy(__alloc, __first, __last);
} else {
- __builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first));
+ // Casting to void* to suppress clang complaining that this is technically UB.
+ __builtin_memcpy(static_cast<void*>(const_cast<__remove_const_t<_Tp>*>(__result)), __first, sizeof(_Tp) * (__last - __first));
}
}
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h
index c0871731cc00..9b0e240de55f 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__type_traits/enable_if.h>
-#include <__type_traits/integral_constant.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_trivially_copyable.h>
@@ -23,8 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// A type is trivially relocatable if a move construct + destroy of the original object is equivalent to
// `memcpy(dst, src, sizeof(T))`.
-
-#if __has_builtin(__is_trivially_relocatable)
+//
+// Note that we don't use the __is_trivially_relocatable Clang builtin right now because it does not
+// implement the semantics of any current or future trivial relocation proposal and it can lead to
+// incorrect optimizations on some platforms (Windows) and supported compilers (AppleClang).
+#if __has_builtin(__is_trivially_relocatable) && 0
template <class _Tp, class = void>
struct __libcpp_is_trivially_relocatable : integral_constant<bool, __is_trivially_relocatable(_Tp)> {};
#else
diff --git a/contrib/llvm-project/libcxx/include/tuple b/contrib/llvm-project/libcxx/include/tuple
index 081b90c7bbec..1d39974d5a6b 100644
--- a/contrib/llvm-project/libcxx/include/tuple
+++ b/contrib/llvm-project/libcxx/include/tuple
@@ -302,7 +302,9 @@ class __tuple_leaf {
template <class _Tp>
static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {
-# if __has_keyword(__reference_binds_to_temporary)
+# if __has_keyword(__reference_constructs_from_temporary)
+ return !__reference_constructs_from_temporary(_Hp, _Tp);
+# elif __has_keyword(__reference_binds_to_temporary)
return !__reference_binds_to_temporary(_Hp, _Tp);
# else
return true;