Date: Thu, 4 May 2023 15:15:04 -0700 From: Mark Millard <marklmi@yahoo.com> To: Dimitry Andric <dim@FreeBSD.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org> Subject: Re: Using -stdlib=libc++ in g++13 requires adding __has_builtin(__is_convertible) handling to __type_traits/is_convertible.h Message-ID: <568556E2-91FD-4F70-88B3-376345CDFB34@yahoo.com> In-Reply-To: <BB0634FB-E50F-43C5-900F-33B3434B9ACF@yahoo.com> References: <BB0634FB-E50F-43C5-900F-33B3434B9ACF@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On May 4, 2023, at 14:07, Mark Millard <marklmi@yahoo.com> wrote: >=20 > I have submitted https://github.com/llvm/llvm-project/issues/62556 for > the issue: >=20 > QUOTE (whitespace details might not be preserved) > On FreeBSD main [so: 14] (still LLVM 15.0.7 based) I updated from = using the > lang/gcc12 port to lang/gcc13 and my use of -stdlib=3Dlibc++ got lots = of error > reports from g++13. But it all turned out to be because = __is_convertible is > a builtin in g++13. The following addition to = __type_traits/is_convertible.h > let me use g++13 -stdlib=3Dlibc++ (basically doing the same as already = done for > __is_convertible_to being a builtin): >=20 > # diff -u /usr/include/c++/v1/__type_traits/is_convertible.h.orig = /usr/include/c++/v1/__type_traits/is_convertible.h > --- /usr/include/c++/v1/__type_traits/is_convertible.h.orig 2023-05-04 = 13:37:14.535549000 -0700 > +++ /usr/include/c++/v1/__type_traits/is_convertible.h 2023-05-04 = 13:33:12.656731000 -0700 > @@ -29,6 +29,11 @@ > template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS = is_convertible > : public integral_constant<bool, __is_convertible_to(_T1, _T2)> = {}; >=20 > +#elif __has_builtin(__is_convertible) && = !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) > + > +template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS = is_convertible > + : public integral_constant<bool, __is_convertible(_T1, _T2)> {}; > + > #else // __has_builtin(__is_convertible_to) && = !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) >=20 > namespace __is_convertible_imp > END QUOTE Looks like this was fixed but will not be back ported to LLVM15: "closed this as not planned" for LLVM15 but there is: https://reviews.llvm.org/rG484e64f7e7b2c0494d7b2dbfdd528bcd707ee652 =3D=3D=3D Mark Millard marklmi at yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?568556E2-91FD-4F70-88B3-376345CDFB34>