From: Andrei Tatar Date: Thu, 4 May 2023 14:20:31 +0000 (+0200) Subject: patches: Backport upstream fix for __is_convertible X-Git-Tag: RELEASE-0.14.0~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4dd24506040b357ff1fea80df73c3d12440eb0bf;p=unikraft%2Flibs%2Flibcxx.git patches: Backport upstream fix for __is_convertible Replicate upstream commit 484e64f7e7b2c0494d7b2dbfdd528bcd707ee652. libcxx previously used the `__is_convertible_to` builtin which wasn't supported by GCC; this patch adds support for `__is_convertible` which is available as of GCC 13. Signed-off-by: Andrei Tatar Reviewed-by: Stefan Jumarea Reviewed-by: Maria Sfiraiala Reviewed-by: Razvan Deaconescu Approved-by: Eduard Vintilă Tested-by: Unikraft CI GitHub-Closes: #28 --- diff --git a/patches/0001-Use-__is_convertible-built-in-when-available.patch b/patches/0001-Use-__is_convertible-built-in-when-available.patch new file mode 100644 index 0000000..faf471c --- /dev/null +++ b/patches/0001-Use-__is_convertible-built-in-when-available.patch @@ -0,0 +1,24 @@ +diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits +index 3391999675..ab126d000d 100644 +--- a/include/type_traits ++++ b/include/type_traits +@@ -1659,11 +1659,18 @@ struct __is_core_convertible<_Tp, _Up, decltype( + + // is_convertible + +-#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) ++#if __has_builtin(__is_convertible) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) ++ ++template ++struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant {}; ++ ++#elif __has_feature(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_feature(is_convertible_to) + + namespace __is_convertible_imp