[cfe-commits] [libcxx] r124502 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.rel/is_base_of.pass.cpp test/utilities/meta/meta.rel/is_convertible.pass.cpp
Howard Hinnant
hhinnant at apple.com
Fri Jan 28 12:00:37 PST 2011
Author: hhinnant
Date: Fri Jan 28 14:00:37 2011
New Revision: 124502
URL: http://llvm.org/viewvc/llvm-project?rev=124502&view=rev
Log:
minor corrections to test, and hook is_base_of up to clang intrinsic
Modified:
libcxx/trunk/include/type_traits
libcxx/trunk/test/utilities/meta/meta.rel/is_base_of.pass.cpp
libcxx/trunk/test/utilities/meta/meta.rel/is_convertible.pass.cpp
Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=124502&r1=124501&r2=124502&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri Jan 28 14:00:37 2011
@@ -709,6 +709,14 @@
// is_base_of
+#ifdef __clang__
+
+template <class _Bp, class _Dp>
+struct _LIBCPP_VISIBLE is_base_of
+ : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
+
+#else // __clang__
+
// (C) Copyright Rani Sharoni 2003.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -755,6 +763,8 @@
{
};
+#endif // __clang__
+
// is_empty
template <class _Tp>
Modified: libcxx/trunk/test/utilities/meta/meta.rel/is_base_of.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.rel/is_base_of.pass.cpp?rev=124502&r1=124501&r2=124502&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.rel/is_base_of.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.rel/is_base_of.pass.cpp Fri Jan 28 14:00:37 2011
@@ -46,5 +46,4 @@
test_is_not_base_of<B&, D&>();
test_is_not_base_of<B[3], D[3]>();
test_is_not_base_of<int, int>();
- test_is_not_base_of<int, int>();
}
Modified: libcxx/trunk/test/utilities/meta/meta.rel/is_convertible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.rel/is_convertible.pass.cpp?rev=124502&r1=124501&r2=124502&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.rel/is_convertible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.rel/is_convertible.pass.cpp Fri Jan 28 14:00:37 2011
@@ -70,8 +70,7 @@
static_assert((!std::is_convertible<Function, Function>::value), "");
- static_assert((!std::is_convertible<Function, Function&>::value), "");
- static_assert((!std::is_convertible<Function, Function&>::value), "");
+ static_assert(( std::is_convertible<Function, Function&>::value), "");
static_assert(( std::is_convertible<Function, Function*>::value), "");
static_assert(( std::is_convertible<Function, Function* const>::value), "");
@@ -98,7 +97,6 @@
static_assert((!std::is_convertible<Function&, Function>::value), "");
static_assert(( std::is_convertible<Function&, Function&>::value), "");
- static_assert(( std::is_convertible<Function&, const Function&>::value), "");
static_assert(( std::is_convertible<Function&, Function*>::value), "");
static_assert(( std::is_convertible<Function&, Function* const>::value), "");
@@ -185,7 +183,7 @@
static_assert((!std::is_convertible<Array, Array&>::value), "");
static_assert(( std::is_convertible<Array, const Array&>::value), "");
static_assert((!std::is_convertible<const Array, Array&>::value), "");
- static_assert((!std::is_convertible<const Array, const Array&>::value), "");
+ static_assert(( std::is_convertible<const Array, const Array&>::value), "");
static_assert((!std::is_convertible<Array, char>::value), "");
static_assert((!std::is_convertible<Array, const char>::value), "");
More information about the cfe-commits
mailing list