From nobody Sat Apr 20 10:34:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VM7Dw1TKRz5HWbP; Sat, 20 Apr 2024 10:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VM7Dv74Ybz4TSZ; Sat, 20 Apr 2024 10:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MDqcY26wn4Z5qJus6SM8NjMi7K805ecJFIeBwDfFXFo=; b=oYT+ULKpfpE1lnxumQehkTytQseq70PaAHST05ki8T057mEfxG07h7tj6tFckIeUt60aoV T/2yKi+f/R+nK9w4DaL1rDLjwlUF8c6bqUxxSdpriNPPPss05awNJPVhwq4Fch3eBNgIce PewvnDi42rntp7inUKI7VYMAou1jsXhWJAt7IUXvpWfCf40VnIFXIp07SSRBvJ6hZpZ5AC wGs/l+TTNB6JbYYeAP5NnGY0o4RKvJabFdsFwZdc3J3VFq820QViRWxEOnBo0QVLozboa4 VuXgnWXSJvdGc/0FT/gIfAO6kbXA9z1s28nsDgNdqD3mv8docQ01wR34fmn1CQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713609296; a=rsa-sha256; cv=none; b=qrfT4NdZ++dZL5DjLcl+LX1SLyGESvaZL1um+3R2R1znhDlhUer7WWH6Q0NodTyaDVzIK3 wIvGNrwgW182ylTFELlvXuumGfezFjJ7SP9Jk+fj1GGRs/xPl03beF+Tg1WuD/QkGvnaA6 Akk1BsZ2qA3oqRw+VfWTp9l93gqcWNQrLb8P6iaVLJks5d/cEQAiqf9GMwvj3t2zMTW8pH haUN6/AwETEEEJPDr0lmBgKLOIK2ehMCrP86Tcd82/jUhXywNrmvmd2naseNyAEB2Md5Yw n0nQ2uKE9rfkZBzfE++1YyMVjRefWLQK/BBOL7LExN+Xz6zAYS2BgUKZ+qdBiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MDqcY26wn4Z5qJus6SM8NjMi7K805ecJFIeBwDfFXFo=; b=pGy8iBTYEWTOIxjRv12b/rzVvAgFy6vHkYSzlDBhM2uVygiPtWh5eL6936bcLCjZK9YlLD 0FLjk5/EQ2ZQF1sxlpkqQgNHqbpDbCMre6gasGoJDn93kHO+PX2+nN66LVVaJXos0dN1nd Q28jAFocU82JKVa4/8KcPk2kmcxF3BFB804OELV7j9ruBFC1dxbM8RlYiqMJ4WbDUQhPdq 8E8GFGBvTpn4Y6ZTejJqYdGuP7047BSlC/VnlmfpnEQbcrb+O8R4/VFSA8ay/lpHA70f3C W45KBeh5obskGGhCdQjULkLy8pl9sE28LqvdJGsiaA+2TfotrBaYfm6pUEbeNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VM7Dv50QFzYrK; Sat, 20 Apr 2024 10:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43KAYtvd014672; Sat, 20 Apr 2024 10:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43KAYtMq014669; Sat, 20 Apr 2024 10:34:55 GMT (envelope-from git) Date: Sat, 20 Apr 2024 10:34:55 GMT Message-Id: <202404201034.43KAYtMq014669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 70ab6e9b180d - stable/13 - Revert commit 925a11a5f221 from llvm-project (by Nikolas Klauser): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70ab6e9b180dd7ed0cce5c9c69dd3348099b63bd Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=70ab6e9b180dd7ed0cce5c9c69dd3348099b63bd commit 70ab6e9b180dd7ed0cce5c9c69dd3348099b63bd Author: Dimitry Andric AuthorDate: 2024-04-13 08:44:26 +0000 Commit: Dimitry Andric CommitDate: 2024-04-20 10:29:10 +0000 Revert commit 925a11a5f221 from llvm-project (by Nikolas Klauser): [libc++] Simplify is_convertible GCC 13 has added __is_convertible(), so we don't need to keep the fallback implementation around. Reviewed By: #libc, Mordante Spies: Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D157939 This should allow buildworld with gcc 12 to work again. PR: 276104 MFC after: 1 month (cherry picked from commit 2365f012951e5f0333cf31c690f668299c86b30e) --- .../libcxx/include/__type_traits/is_convertible.h | 79 +++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_convertible.h b/contrib/llvm-project/libcxx/include/__type_traits/is_convertible.h index bc91d8b23430..b378a20cedeb 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_convertible.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_convertible.h @@ -24,12 +24,89 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__is_convertible) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) + template struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant {}; +#elif __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) + +template +struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant {}; + +// TODO: Remove this fallback when GCC < 13 support is no longer required. +// GCC 13 has the __is_convertible built-in. +#else // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) + +namespace __is_convertible_imp { +template +void __test_convert(_Tp); + +template +struct __is_convertible_test : public false_type {}; + +template +struct __is_convertible_test<_From, _To, decltype(__is_convertible_imp::__test_convert<_To>(std::declval<_From>()))> + : public true_type {}; + +// clang-format off +template ::value, + bool _IsFunction = is_function<_Tp>::value, + bool _IsVoid = is_void<_Tp>::value> + struct __is_array_function_or_void { enum { value = 0 }; }; +template struct __is_array_function_or_void<_Tp, true, false, false> { enum { value = 1 }; }; +template struct __is_array_function_or_void<_Tp, false, true, false> { enum { value = 2 }; }; +template struct __is_array_function_or_void<_Tp, false, false, true> { enum { value = 3 }; }; +// clang-format on +} // namespace __is_convertible_imp + +template >::value> +struct __is_convertible_check { + static const size_t __v = 0; +}; + +template +struct __is_convertible_check<_Tp, 0> { + static const size_t __v = sizeof(_Tp); +}; + +template ::value, + unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value> +struct __is_convertible + : public integral_constant::value >{}; + +// clang-format off +template struct __is_convertible<_T1, _T2, 0, 1> : public false_type{}; +template struct __is_convertible<_T1, _T2, 1, 1> : public false_type{}; +template struct __is_convertible<_T1, _T2, 2, 1> : public false_type{}; +template struct __is_convertible<_T1, _T2, 3, 1> : public false_type{}; + +template struct __is_convertible<_T1, _T2, 0, 2> : public false_type{}; +template struct __is_convertible<_T1, _T2, 1, 2> : public false_type{}; +template struct __is_convertible<_T1, _T2, 2, 2> : public false_type{}; +template struct __is_convertible<_T1, _T2, 3, 2> : public false_type{}; + +template struct __is_convertible<_T1, _T2, 0, 3> : public false_type{}; +template struct __is_convertible<_T1, _T2, 1, 3> : public false_type{}; +template struct __is_convertible<_T1, _T2, 2, 3> : public false_type{}; +template struct __is_convertible<_T1, _T2, 3, 3> : public true_type{}; +// clang-format on + +template +struct _LIBCPP_TEMPLATE_VIS is_convertible : public __is_convertible<_T1, _T2> { + static const size_t __complete_check1 = __is_convertible_check<_T1>::__v; + static const size_t __complete_check2 = __is_convertible_check<_T2>::__v; +}; + +#endif // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) + #if _LIBCPP_STD_VER >= 17 template -inline constexpr bool is_convertible_v = __is_convertible(_From, _To); +inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value; #endif _LIBCPP_END_NAMESPACE_STD