From ffbfbcda66a4cdab4fc6a84fc571b9f1b9fad70f Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 19 Mar 2015 21:11:02 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232764 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/type_traits | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/type_traits b/include/type_traits index 0655a685a..184926a50 100644 --- a/include/type_traits +++ b/include/type_traits @@ -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 struct _LIBCPP_TYPE_VIS_ONLY is_convertible : public integral_constant struct __is_convertible<_T1, _T2, 1, 0> : false_type {}; template struct __is_convertible<_T1, const _T1&, 1, 0> : true_type {}; +template struct __is_convertible : true_type {}; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template struct __is_convertible<_T1, _T1&&, 1, 0> : true_type {}; template struct __is_convertible<_T1, const _T1&&, 1, 0> : true_type {};