From owner-svn-src-vendor@freebsd.org Wed Jan 24 20:25:58 2018 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41ED1EC3CB7; Wed, 24 Jan 2018 20:25:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65E0C76551; Wed, 24 Jan 2018 20:25:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8834C22796; Wed, 24 Jan 2018 20:25:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0OKPuW1043008; Wed, 24 Jan 2018 20:25:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0OKPuoI043006; Wed, 24 Jan 2018 20:25:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801242025.w0OKPuoI043006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 24 Jan 2018 20:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r328368 - in vendor/libc++/dist-release_60: include test/std/utilities/meta/meta.unary/meta.unary.prop X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist-release_60: include test/std/utilities/meta/meta.unary/meta.unary.prop X-SVN-Commit-Revision: 328368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 20:25:58 -0000 Author: dim Date: Wed Jan 24 20:25:56 2018 New Revision: 328368 URL: https://svnweb.freebsd.org/changeset/base/328368 Log: Vendor import of libc++ release_60 branch r323338: https://llvm.org/svn/llvm-project/libcxx/branches/release_60@323338 Modified: vendor/libc++/dist-release_60/include/type_traits vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp Modified: vendor/libc++/dist-release_60/include/type_traits ============================================================================== --- vendor/libc++/dist-release_60/include/type_traits Wed Jan 24 20:25:51 2018 (r328367) +++ vendor/libc++/dist-release_60/include/type_traits Wed Jan 24 20:25:56 2018 (r328368) @@ -3172,6 +3172,14 @@ template false_type __is_constructible2_test(__any, _A0&, _A1&); +template +decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>(), _VSTD::declval<_A2>()), true_type())) +__is_constructible3_test(_Tp&, _A0&, _A1&, _A2&); + +template +false_type +__is_constructible3_test(__any, _A0&, _A1&, _A2&); + template struct __is_constructible0_imp // false, _Tp is not a scalar : public common_type @@ -3196,6 +3204,14 @@ struct __is_constructible2_imp // false, _Tp is not a >::type {}; +template +struct __is_constructible3_imp // false, _Tp is not a scalar + : public common_type + < + decltype(__is_constructible3_test(declval<_Tp&>(), declval<_A0>(), declval<_A1>(), declval<_A2>())) + >::type + {}; + // handle scalars and reference types // Scalars are default constructible, references are not @@ -3215,6 +3231,11 @@ struct __is_constructible2_imp : public false_type {}; +template +struct __is_constructible3_imp + : public false_type + {}; + // Treat scalars and reference types separately template @@ -3235,6 +3256,12 @@ struct __is_constructible2_void_check _Tp, _A0, _A1> {}; +template +struct __is_constructible3_void_check + : public __is_constructible3_imp::value || is_reference<_Tp>::value, + _Tp, _A0, _A1, _A2> + {}; + // If any of T or Args is void, is_constructible should be false template @@ -3252,17 +3279,24 @@ struct __is_constructible2_void_check +struct __is_constructible3_void_check + : public false_type + {}; + // is_constructible entry point template + class _A1 = __is_construct::__nat, + class _A2 = __is_construct::__nat> struct _LIBCPP_TEMPLATE_VIS is_constructible - : public __is_constructible2_void_check::value + : public __is_constructible3_void_check::value || is_abstract<_Tp>::value || is_function<_Tp>::value || is_void<_A0>::value - || is_void<_A1>::value, - _Tp, _A0, _A1> + || is_void<_A1>::value + || is_void<_A2>::value, + _Tp, _A0, _A1, _A2> {}; template @@ -3282,6 +3316,16 @@ struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, _Tp, _A0> {}; +template +struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, _A1, __is_construct::__nat> + : public __is_constructible2_void_check::value + || is_abstract<_Tp>::value + || is_function<_Tp>::value + || is_void<_A0>::value + || is_void<_A1>::value, + _Tp, _A0, _A1> + {}; + // Array types are default constructible if their element type // is default constructible @@ -3300,6 +3344,11 @@ struct __is_constructible2_imp +struct __is_constructible3_imp + : public false_type + {}; + // Incomplete array types are not constructible template @@ -3314,6 +3363,11 @@ struct __is_constructible1_imp template struct __is_constructible2_imp + : public false_type + {}; + +template +struct __is_constructible3_imp : public false_type {}; Modified: vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp ============================================================================== --- vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp Wed Jan 24 20:25:51 2018 (r328367) +++ vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp Wed Jan 24 20:25:56 2018 (r328368) @@ -30,6 +30,7 @@ struct A { explicit A(int); A(int, double); + A(int, long, double); #if TEST_STD_VER >= 11 private: #endif @@ -106,6 +107,16 @@ void test_is_constructible() #endif } +template +void test_is_constructible() +{ + static_assert(( std::is_constructible::value), ""); + LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible::type::value), ""); +#if TEST_STD_VER > 14 + static_assert(( std::is_constructible_v), ""); +#endif +} + template void test_is_not_constructible() { @@ -146,6 +157,7 @@ int main() test_is_constructible (); test_is_constructible (); test_is_constructible (); + test_is_constructible (); test_is_constructible (); test_is_not_constructible ();