diff --git a/include/type_traits b/include/type_traits index bcad2acd..ee8877cf 100644 --- a/include/type_traits +++ b/include/type_traits @@ -772,6 +772,14 @@ template struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp // is_polymorphic +#if __has_feature(is_polymorphic) + +template +struct _LIBCPP_VISIBLE is_polymorphic + : public integral_constant {}; + +#else + template struct __is_polymorphic1 : public _Tp {}; template struct __is_polymorphic2 : public _Tp {virtual ~__is_polymorphic2() throw();}; @@ -784,6 +792,8 @@ template struct __libcpp_polymorphic<_Tp, false> : public false_type template struct _LIBCPP_VISIBLE is_polymorphic : public __libcpp_polymorphic<_Tp> {}; +#endif // __has_feature(is_polymorphic) + // has_virtual_destructor #if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)