[libcxx] r232764 - Create macro to allow testing of is_convertible without the compiler builtin.
Eric Fiselier
eric at efcs.ca
Thu Mar 19 14:11:03 PDT 2015
Author: ericwf
Date: Thu Mar 19 16:11:02 2015
New Revision: 232764
URL: http://llvm.org/viewvc/llvm-project?rev=232764&view=rev
Log:
Create macro to allow testing of is_convertible without the compiler builtin.
Summary: This patch also fixes one test case that failed in the library version of is_convertible.
Reviewers: mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D8456
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=232764&r1=232763&r2=232764&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Thu Mar 19 16:11:02 2015
@@ -838,7 +838,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_base_of
// is_convertible
-#if __has_feature(is_convertible_to)
+#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
: public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
@@ -900,6 +900,7 @@ struct __is_convertible
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 0> : false_type {};
template <class _T1> struct __is_convertible<_T1, const _T1&, 1, 0> : true_type {};
+template <class _T1> struct __is_convertible<const _T1, const _T1&, 1, 0> : true_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _T1> struct __is_convertible<_T1, _T1&&, 1, 0> : true_type {};
template <class _T1> struct __is_convertible<_T1, const _T1&&, 1, 0> : true_type {};
More information about the cfe-commits
mailing list