[libc-commits] [libc] [libc] continues header cleanup process (PR #65556)

Christopher Di Bella via libc-commits libc-commits at lists.llvm.org
Wed Sep 6 17:50:42 PDT 2023


https://github.com/cjdb updated https://github.com/llvm/llvm-project/pull/65556:

>From b594e991ff37df10937f7e8b679e62d9e0f016da Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Thu, 7 Sep 2023 00:36:42 +0000
Subject: [PATCH 1/2] [libc] continues header cleanup process

* replaces `add_rvalue_reference_t` with `is_rvalue_reference_t`
* includes `"stddef.h"` for `size_t` include
---
 libc/src/__support/CPP/type_traits/is_rvalue_reference.h | 2 +-
 libc/src/__support/CPP/type_traits/remove_extent.h       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h b/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
index 33b2037df013810..39b8954800e2dad 100644
--- a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
+++ b/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
@@ -25,7 +25,7 @@ template <typename T> struct is_rvalue_reference : public false_type {};
 template <typename T> struct is_rvalue_reference<T &&> : public true_type {};
 #endif
 template <class T>
-using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
+LIBC_INLINE constexpr is_rvalue_reference_v = is_rvalue_reference<T>::value;
 
 } // namespace __llvm_libc::cpp
 
diff --git a/libc/src/__support/CPP/type_traits/remove_extent.h b/libc/src/__support/CPP/type_traits/remove_extent.h
index cc92f8fd080bf29..a480001ad660663 100644
--- a/libc/src/__support/CPP/type_traits/remove_extent.h
+++ b/libc/src/__support/CPP/type_traits/remove_extent.h
@@ -9,6 +9,7 @@
 #define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H
 
 #include "src/__support/CPP/type_traits/type_identity.h"
+#include "stddef.h"
 
 namespace __llvm_libc::cpp {
 

>From 5803c49810a024cb360b4494c971a07649d63739 Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Thu, 7 Sep 2023 00:50:21 +0000
Subject: [PATCH 2/2] adds type specifier

---
 libc/src/__support/CPP/type_traits/is_rvalue_reference.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h b/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
index 39b8954800e2dad..cffe41a31c25fc9 100644
--- a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
+++ b/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
@@ -25,7 +25,7 @@ template <typename T> struct is_rvalue_reference : public false_type {};
 template <typename T> struct is_rvalue_reference<T &&> : public true_type {};
 #endif
 template <class T>
-LIBC_INLINE constexpr is_rvalue_reference_v = is_rvalue_reference<T>::value;
+LIBC_INLINE constexpr bool is_rvalue_reference_v = is_rvalue_reference<T>::value;
 
 } // namespace __llvm_libc::cpp
 



More information about the libc-commits mailing list