Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2023 14:07:55 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Dimitry Andric <dim@FreeBSD.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Using -stdlib=libc++ in g++13 requires adding __has_builtin(__is_convertible) handling to __type_traits/is_convertible.h
Message-ID:  <BB0634FB-E50F-43C5-900F-33B3434B9ACF@yahoo.com>
References:  <BB0634FB-E50F-43C5-900F-33B3434B9ACF.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I have submitted https://github.com/llvm/llvm-project/issues/62556 for
the issue:

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):

# 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


=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?BB0634FB-E50F-43C5-900F-33B3434B9ACF>