[libcxx-commits] [libcxx] r364054 - Remove dead non-variadic workarounds in <type_traits>

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 21 07:37:28 PDT 2019


Author: ericwf
Date: Fri Jun 21 07:37:28 2019
New Revision: 364054

URL: http://llvm.org/viewvc/llvm-project?rev=364054&view=rev
Log:
Remove dead non-variadic workarounds in <type_traits>

We can use variadics with clang

Modified:
    libcxx/trunk/include/type_traits

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=364054&r1=364053&r2=364054&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri Jun 21 07:37:28 2019
@@ -2372,8 +2372,6 @@ __decay_copy(const _Tp& __t)
 
 #endif
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
 template <class _Rp, class _Class, class ..._Param>
 struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
 {
@@ -2570,265 +2568,6 @@ struct __member_pointer_traits_imp<_Rp (
 
 #endif  // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC)
 
-#else  // _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) ();
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(...), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (...);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...), true, false>
-{
-    typedef _Class _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) ();
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (...);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const, true, false>
-{
-    typedef _Class const _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) ();
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(...) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (...);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) volatile, true, false>
-{
-    typedef _Class volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) ();
-};
-
-template <class _Rp, class _Class>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (...);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0);
-};
-
-template <class _Rp, class _Class, class _P0>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, ...);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2);
-};
-
-template <class _Rp, class _Class, class _P0, class _P1, class _P2>
-struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const volatile, true, false>
-{
-    typedef _Class const volatile _ClassType;
-    typedef _Rp _ReturnType;
-    typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
-};
-
-#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Rp, class _Class>
 struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
@@ -3143,7 +2882,7 @@ struct _LIBCPP_TEMPLATE_VIS is_construct
     : public __libcpp_is_constructible<_Tp, _Args...>::type {};
 #endif
 
-#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
 template <class _Tp, class ..._Args>
 _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_constructible_v
     = is_constructible<_Tp, _Args...>::value;
@@ -3194,8 +2933,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR boo
 
 // is_trivially_constructible
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
 #if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501
 
 template <class _Tp, class... _Args>
@@ -3246,80 +2983,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially
 
 #endif  // !__has_feature(is_trivially_constructible)
 
-#else  // _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Tp, class _A0 = __is_construct::__nat,
-                     class _A1 = __is_construct::__nat>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
-    : false_type
-{
-};
-
-#if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, __is_trivially_constructible(_Tp)>
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp)>
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)>
-{
-};
 
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&)>
-{
-};
-
-#else  // !__has_feature(is_trivially_constructible)
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, is_scalar<_Tp>::value>
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, is_scalar<_Tp>::value>
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, is_scalar<_Tp>::value>
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&,
-                                                       __is_construct::__nat>
-    : integral_constant<bool, is_scalar<_Tp>::value>
-{
-};
-
-#endif  // !__has_feature(is_trivially_constructible)
-
-#endif  // _LIBCPP_HAS_NO_VARIADICS
-
-#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
 template <class _Tp, class... _Args>
 _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_constructible_v
     = is_trivially_constructible<_Tp, _Args...>::value;
@@ -3472,8 +3137,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR boo
 
 // is_nothrow_constructible
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
 #if __has_keyword(__is_nothrow_constructible)
 
 template <class _Tp, class... _Args>
@@ -3571,80 +3234,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_c
 
 #endif  // _LIBCPP_HAS_NO_NOEXCEPT
 
-#else  // _LIBCPP_HAS_NO_VARIADICS
-
-#if __has_keyword(__is_nothrow_constructible)
 
-template <class _Tp, class _A0 = __is_construct::__nat,
-                     class _A1 = __is_construct::__nat>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
-    : public integral_constant<bool, __is_nothrow_constructible(_Tp, _A0, _A1)> {};
-
-template <class _Tp, class _A0>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _A0>
-    : public integral_constant<bool, __is_nothrow_constructible(_Tp, _A0)> {};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp>
-    : public integral_constant<bool, __is_nothrow_constructible(_Tp)> {};
-
-#else  // __has_keyword(__is_nothrow_constructible)
-
-template <class _Tp, class _A0 = __is_construct::__nat,
-                     class _A1 = __is_construct::__nat>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
-    : false_type
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat,
-                                                       __is_construct::__nat>
-#if __has_feature(has_nothrow_constructor) || defined(_LIBCPP_COMPILER_GCC)
-    : integral_constant<bool, __has_nothrow_constructor(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<_Tp>::value>
-#endif
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp,
-                                                       __is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC)
-    : integral_constant<bool, __has_nothrow_copy(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<_Tp>::value>
-#endif
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&,
-                                                       __is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC)
-    : integral_constant<bool, __has_nothrow_copy(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<_Tp>::value>
-#endif
-{
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&,
-                                                       __is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC)
-    : integral_constant<bool, __has_nothrow_copy(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<_Tp>::value>
-#endif
-{
-};
-
-#endif  // __has_keyword(__is_nothrow_constructible)
-#endif  // _LIBCPP_HAS_NO_VARIADICS
-
-#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
 template <class _Tp, class ..._Args>
 _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v
     = is_nothrow_constructible<_Tp, _Args...>::value;
@@ -4524,7 +4115,6 @@ struct __has_operator_addressof
 
 template <class...> using void_t = void;
 
-# ifndef _LIBCPP_HAS_NO_VARIADICS
 template <class... _Args>
 struct conjunction : __and_<_Args...> {};
 template<class... _Args>
@@ -4542,7 +4132,6 @@ struct negation : __not_<_Tp> {};
 template<class _Tp>
 _LIBCPP_INLINE_VAR constexpr bool negation_v
     = negation<_Tp>::value;
-# endif // _LIBCPP_HAS_NO_VARIADICS
 #endif  // _LIBCPP_STD_VER > 14
 
 // These traits are used in __tree and __hash_table




More information about the libcxx-commits mailing list