Use __is_polymorphic if available. This fixes http://llvm.org/bugs/show_bug.cgi?id=11983 . Patch contributed by Jonathan Sauer.

llvm-svn: 150614
This commit is contained in:
Howard Hinnant 2012-02-15 20:47:11 +00:00
parent fa8df7db88
commit f9c73f6629
1 changed files with 10 additions and 0 deletions

View File

@ -772,6 +772,14 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp
// is_polymorphic
#if __has_feature(is_polymorphic)
template <class _Tp>
struct _LIBCPP_VISIBLE is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)> {};
#else
template <class _Tp> struct __is_polymorphic1 : public _Tp {};
template <class _Tp> struct __is_polymorphic2 : public _Tp {virtual ~__is_polymorphic2() throw();};
@ -784,6 +792,8 @@ template <class _Tp> struct __libcpp_polymorphic<_Tp, false> : public false_type
template <class _Tp> 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)