Skip to content

Commit 7969946

Browse files
committed
[libc++][NFC] Use more appropriate type traits for a few cases
1 parent 05b6c2e commit 7969946

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

libcxx/include/__tuple/make_tuple_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <__tuple/tuple_size.h>
1919
#include <__tuple/tuple_types.h>
2020
#include <__type_traits/copy_cvref.h>
21-
#include <__type_traits/remove_cv.h>
21+
#include <__type_traits/remove_cvref.h>
2222
#include <__type_traits/remove_reference.h>
2323

2424
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -58,7 +58,7 @@ template <class _Tp,
5858
bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
5959
struct __make_tuple_types {
6060
static_assert(_Sp <= _Ep, "__make_tuple_types input error");
61-
using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
61+
using _RawTp = __remove_cvref_t<_Tp>;
6262
using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
6363
using type = typename _Maker::template __apply_quals<_Tp>;
6464
};

libcxx/include/new

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ void operator delete[](void* ptr, void*) noexcept;
8989
#include <__config>
9090
#include <__exception/exception.h>
9191
#include <__type_traits/is_function.h>
92-
#include <__type_traits/is_same.h>
93-
#include <__type_traits/remove_cv.h>
92+
#include <__type_traits/is_void.h>
9493
#include <__verbose_abort>
9594
#include <cstddef>
9695
#include <version>
@@ -342,7 +341,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __libcpp_deallocate_unsized(void* __ptr, size_
342341
template <class _Tp>
343342
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT {
344343
static_assert(!(is_function<_Tp>::value), "can't launder functions");
345-
static_assert(!(is_same<void, __remove_cv_t<_Tp> >::value), "can't launder cv-void");
344+
static_assert(!is_void<_Tp>::value, "can't launder cv-void");
346345
return __builtin_launder(__p);
347346
}
348347

0 commit comments

Comments
 (0)