Date: Fri, 9 Dec 2016 14:41:58 +0000 (UTC) From: "Carlos J. Puga Medina" <cpm@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r428209 - branches/2016Q4/devel/libc++/files Message-ID: <201612091441.uB9EfwCW008160@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cpm Date: Fri Dec 9 14:41:58 2016 New Revision: 428209 URL: https://svnweb.freebsd.org/changeset/ports/428209 Log: MFH: r428042 devel/libc++: Fix std::is_function<void() const> failed In file included from /usr/include/c++/v1/string:439: In file included from /usr/include/c++/v1/algorithm:624: /usr/include/c++/v1/type_traits:433:76: error: no matching function for call to '__source' : public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/v1/type_traits:438:14: note: in instantiation of template class 'std::__1::__libcpp_is_function<void (unsigned char *) const, false>' requested here : public __libcpp_is_function<_Tp> {}; ^ /usr/include/c++/v1/type_traits:443:97: note: in instantiation of template class 'std::__1::is_function<void (unsigned char *) const>' requested here template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; ^ /usr/include/c++/v1/type_traits:446:14: note: in instantiation of template class 'std::__1::__libcpp_is_member_function_pointer<void (flatbuffers::simple_allocator::*)(unsigned char *) const>' requested here : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {}; ^ PR: 215016 Submitted by: cpm Reviewed by: dim (maintainer) Approved by: dim (maintainer), feld (mentor, implicit) Obtained from: https://reviews.llvm.org/D7573 Approved by: ports-secteam (junovitch) Added: branches/2016Q4/devel/libc++/files/patch-include_type__traits - copied unchanged from r428042, head/devel/libc++/files/patch-include_type__traits branches/2016Q4/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp - copied unchanged from r428042, head/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp Modified: Directory Properties: branches/2016Q4/ (props changed) Copied: branches/2016Q4/devel/libc++/files/patch-include_type__traits (from r428042, head/devel/libc++/files/patch-include_type__traits) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/devel/libc++/files/patch-include_type__traits Fri Dec 9 14:41:58 2016 (r428209, copy of r428042, head/devel/libc++/files/patch-include_type__traits) @@ -0,0 +1,25 @@ +--- include/type_traits.orig 2016-11-30 20:55:20 UTC ++++ include/type_traits +@@ -424,9 +424,12 @@ template <class _Tp> struct _ + + namespace __libcpp_is_function_imp + { ++struct __dummy_type {}; + template <class _Tp> char __test(_Tp*); ++template <class _Tp> char __test(__dummy_type); + template <class _Tp> __two __test(...); +-template <class _Tp> _Tp& __source(); ++template <class _Tp> _Tp& __source(int); ++template <class _Tp> __dummy_type __source(long); + } + + template <class _Tp, bool = is_class<_Tp>::value || +@@ -435,7 +438,7 @@ template <class _Tp, bool = is_class<_Tp + is_reference<_Tp>::value || + __is_nullptr_t<_Tp>::value > + struct __libcpp_is_function +- : public integral_constant<bool, sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>())) == 1> ++ : public integral_constant<bool, sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>(0))) == 1> + {}; + template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {}; + Copied: branches/2016Q4/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp (from r428042, head/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp Fri Dec 9 14:41:58 2016 (r428209, copy of r428042, head/devel/libc++/files/patch-test_utilities_meta_meta.unary_meta.unary.cat_function.pass.cpp) @@ -0,0 +1,58 @@ +--- test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp.orig 2013-10-05 21:21:17 UTC ++++ test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp +@@ -14,7 +14,7 @@ + #include <type_traits> + + template <class T> +-void test_function_imp() ++void test() + { + static_assert(!std::is_void<T>::value, ""); + #if _LIBCPP_STD_VER > 11 +@@ -34,19 +34,34 @@ void test_function_imp() + static_assert( std::is_function<T>::value, ""); + } + +-template <class T> +-void test_function() +-{ +- test_function_imp<T>(); +- test_function_imp<const T>(); +- test_function_imp<volatile T>(); +- test_function_imp<const volatile T>(); +-} ++// Since we can't actually add the const volatile and ref qualifiers once ++// later let's use a macro to do it. ++#define TEST_REGULAR(...) \ ++ test<__VA_ARGS__>(); \ ++ test<__VA_ARGS__ const>(); \ ++ test<__VA_ARGS__ volatile>(); \ ++ test<__VA_ARGS__ cons volatile>() ++ ++#define TEST_REF_QUALIFIED(...) \ ++ test<__VA_ARGS__ &>(); \ ++ test<__VA_ARGS__ const &>(); \ ++ test<__VA_ARGS__ volatile &>(); \ ++ test<__VA_ARGS__ const volatile &>(); \ ++ test<__VA_ARGS__ &&>(); \ ++ test<__VA_ARGS__ const &&>(); \ ++ test<__VA_ARGS__ volatile &&>(); \ ++ test<__VA_ARGS__ const volatile &&>() + + int main() + { +- test_function<void ()>(); +- test_function<void (int)>(); +- test_function<int (double)>(); +- test_function<int (double, char)>(); ++ TEST_REGULAR( void () ); ++ TEST_REGULAR( void (int) ); ++ TEST_REGULAR( int (double) ); ++ TEST_REGULAR( int (double, char) ); ++#if __cplusplus >= 201103L ++ TEST_REF_QUALIFIED( void () ); ++ TEST_REF_QUALIFIED( void (int) ); ++ TEST_REF_QUALIFIED( int (double) ); ++ TEST_REF_QUALIFIED( int (double, char) ); ++#endif + }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612091441.uB9EfwCW008160>