summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-03-19 21:11:02 +0000
committerEric Fiselier <eric@efcs.ca>2015-03-19 21:11:02 +0000
commitd4e0263e0aa501948853e00d8a59426cd1c3a6b5 (patch)
tree89ac2ea0880d881bbd5581ca9ea96d4fd3c5b60b /libcxx
parentdcb54db8090f8e2a10ef3b86b193f3e6b28265cf (diff)
downloadbcm5719-llvm-d4e0263e0aa501948853e00d8a59426cd1c3a6b5.tar.gz
bcm5719-llvm-d4e0263e0aa501948853e00d8a59426cd1c3a6b5.zip
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 llvm-svn: 232764
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/type_traits3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 0655a685a2e..184926a50b6 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/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 <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 {};
OpenPOWER on IntegriCloud