[cfe-commits] [libcxx] r124429 - /libcxx/trunk/include/type_traits

Howard Hinnant hhinnant at apple.com
Thu Jan 27 13:00:00 PST 2011


Author: hhinnant
Date: Thu Jan 27 15:00:00 2011
New Revision: 124429

URL: http://llvm.org/viewvc/llvm-project?rev=124429&view=rev
Log:
Reverted previous fix to is_convertible as it caused more problems than it fixed.  But this reverted fix will only matter for non-clang compilers.  Installed __is_convertible_to for 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=124429&r1=124428&r2=124429&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Thu Jan 27 15:00:00 2011
@@ -598,9 +598,22 @@
 
 // is_convertible
 
+#ifdef __clang__
+
+template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
+    : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
+{
+};
+
+#else  // __clang__
+
 namespace __is_convertible_imp
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp> char  __test(const volatile typename remove_reference<_Tp>::type&&);
+#else
 template <class _Tp> char  __test(_Tp);
+#endif
 template <class _Tp> __two __test(...);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 template <class _Tp> _Tp&& __source();
@@ -694,6 +707,8 @@
     static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
 };
 
+#endif  // __clang__
+
 // is_base_of
 
 //  (C) Copyright Rani Sharoni 2003.





More information about the cfe-commits mailing list