From ac89571d200d0893be076aad48a49c2046ee6084 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Sun, 8 Jul 2018 00:06:27 +0000 Subject: [PATCH] type_traits: aligned_union is NOT the same as __uncvref [NFC] llvm-svn: 336502 --- libcxx/include/type_traits | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 7234b98..30bfb16 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -21,7 +21,7 @@ namespace std template struct integral_constant; typedef integral_constant true_type; // C++11 typedef integral_constant false_type; // C++11 - + template // C++14 using bool_constant = integral_constant; // C++14 typedef bool_constant true_type; // C++14 @@ -172,7 +172,7 @@ namespace std using add_volatile_t = typename add_volatile::type; // C++14 template using add_cv_t = typename add_cv::type; // C++14 - + // reference modifications: template using remove_reference_t = typename remove_reference::type; // C++14 @@ -180,13 +180,13 @@ namespace std using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++14 template using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++14 - + // sign modifications: template using make_signed_t = typename make_signed::type; // C++14 template using make_unsigned_t = typename make_unsigned::type; // C++14 - + // array modifications: template using remove_extent_t = typename remove_extent::type; // C++14 @@ -223,7 +223,7 @@ namespace std template using void_t = void; // C++17 - + // See C++14 20.10.4.1, primary type categories template inline constexpr bool is_void_v = is_void::value; // C++17 @@ -386,13 +386,13 @@ namespace std // [meta.logical], logical operator traits: template struct conjunction; // C++17 - template + template inline constexpr bool conjunction_v = conjunction::value; // C++17 template struct disjunction; // C++17 template inline constexpr bool disjunction_v = disjunction::value; // C++17 template struct negation; // C++17 - template + template inline constexpr bool negation_v = negation::value; // C++17 } @@ -595,7 +595,7 @@ template struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {}; template -struct __and_<_B0, _B1, _B2, _Bn...> +struct __and_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {}; // __or_ @@ -608,11 +608,11 @@ template struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {}; template -struct __or_<_B0, _B1, _B2, _Bn...> +struct __or_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {}; // __not_ -template +template struct __not_ : conditional<_Tp::value, false_type, true_type>::type {}; #endif // !defined(_LIBCPP_CXX03_LANG) @@ -903,7 +903,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_function_v // template struct __libcpp_is_member_function_pointer : public false_type {}; // template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; -// +// template struct __member_pointer_traits_imp @@ -1184,7 +1184,7 @@ struct __is_same_uncvref : is_same::type, typename __uncvref<_Up>::type> {}; #if _LIBCPP_STD_VER > 17 -// aligned_union - same as __uncvref +// remove_cvref - same as __uncvref template struct remove_cvref : public __uncvref<_Tp> {}; @@ -1211,12 +1211,12 @@ template using remove_pointer_t = typename remove_pointer<_Tp>::type // add_pointer -template ::value || +template ::value || is_same::type, void>::value> struct __add_pointer_impl {typedef typename remove_reference<_Tp>::type* type;}; -template struct __add_pointer_impl<_Tp, false> +template struct __add_pointer_impl<_Tp, false> {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS add_pointer @@ -1630,7 +1630,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_virtual_destructor_v #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS) template struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations - : public integral_constant>)> {}; #if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -2241,7 +2241,7 @@ struct __is_destructor_wellformed { template static __two __test (...); - + static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char); }; @@ -2249,8 +2249,8 @@ template struct __destructible_imp; template -struct __destructible_imp<_Tp, false> - : public _VSTD::integral_constant + : public _VSTD::integral_constant::type>::value> {}; template @@ -3401,7 +3401,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_default_constructible_v template struct _LIBCPP_TEMPLATE_VIS is_copy_constructible - : public is_constructible<_Tp, + : public is_constructible<_Tp, typename add_lvalue_reference::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -4109,7 +4109,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_literal_type is_reference::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v @@ -4125,7 +4125,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_standard_layout : integral_constant::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_standard_layout_v @@ -4143,7 +4143,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable : integral_constant::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copyable_v @@ -4830,7 +4830,7 @@ template constexpr typename enable_if, byte>::type & operator<<=(byte& __lhs, _Integer __shift) noexcept { return __lhs = __lhs << __shift; } - + template constexpr typename enable_if, byte>::type operator<< (byte __lhs, _Integer __shift) noexcept @@ -4845,7 +4845,7 @@ template constexpr typename enable_if, byte>::type operator>> (byte __lhs, _Integer __shift) noexcept { return static_cast(static_cast(static_cast(__lhs) >> __shift)); } - + template constexpr typename enable_if, _Integer>::type to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); } -- 2.7.4