<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62556>62556</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Using -stdlib=libc++ in g++13 requires adding __has_builtin(__is_convertible) handling to __type_traits/is_convertible.h
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          markmi
      </td>
    </tr>
</table>

<pre>
    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=libc++` 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=libc++` (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)> {};
 
+#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)
 
 namespace __is_convertible_imp
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vd1u4zYTfRr6ZiCBIq2_C11YtgUEn_fboMnmVqCkkcyWEl2SSpG3Lyj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