aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/patches/79-is_void-is_null_pointer-clang14.patch
blob: 5bf4f6b06573a7c15f48b97ca51066106c3c686d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff --git a/include/__type_traits/is_null_pointer.h b/include/__type_traits/is_null_pointer.h
index abc5d14..302b2f8 100644
--- a/include/__type_traits/is_null_pointer.h
+++ b/include/__type_traits/is_null_pointer.h
@@ -12,6 +12,7 @@
 #include <__config>
 #include <__cstddef/nullptr_t.h>
 #include <__type_traits/integral_constant.h>
+#include <__type_traits/remove_cv.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
@@ -20,7 +21,11 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
+#if __has_builtin(__remove_cv)
 inline const bool __is_null_pointer_v = __is_same(__remove_cv(_Tp), nullptr_t);
+#else
+inline const bool __is_null_pointer_v = __is_same(__remove_cv_t<_Tp>, nullptr_t);
+#endif
 
 #if _LIBCPP_STD_VER >= 14
 template <class _Tp>
diff --git a/include/__type_traits/is_void.h b/include/__type_traits/is_void.h
index 562faae..813bf45 100644
--- a/include/__type_traits/is_void.h
+++ b/include/__type_traits/is_void.h
@@ -11,6 +11,7 @@
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
+#include <__type_traits/remove_cv.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
@@ -19,11 +20,19 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
+#if __has_builtin(__remove_cv)
 struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_same(__remove_cv(_Tp), void)> {};
+#else
+struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_same(__remove_cv_t<_Tp>, void)> {};
+#endif
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
+#   if __has_builtin(__remove_cv)
 inline constexpr bool is_void_v = __is_same(__remove_cv(_Tp), void);
+#   else
+inline constexpr bool is_void_v = __is_same(__remove_cv_t<_Tp>, void);
+#   endif
 #endif
 
 _LIBCPP_END_NAMESPACE_STD