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

    <tr>
        <th>Summary</th>
        <td>
            [libc] 17.0.0-rc3 build fail with Clang 16 and GCC 13
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang,
            libc,
            new issue
      </td>
    </tr>

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

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

<pre>
    Hi, I used fresh ubuntu:23.04 container, installed `clang lld gcc-13 libstdc++-13-dev` and other build requirements there.
Running
```shell
cmake -G Ninja "${LLVM_PROJECT_DIR}/llvm" \
  -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ \
 -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_USE_LINKER=lld \
 -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-linux-gnu" \
 -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;polly' \
 -DLLVM_ENABLE_RUNTIMES='libc' \
 -DLLVM_TARGETS_TO_BUILD=X86
ninja
```
results in a ton of following errors when building libc:
```console
In file included from /test/work/llvm-project/libc/src/fenv/fegetenv.cpp:10:
In file included from /test/work/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:17:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/math.h:36:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cmath:41:
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/requires_hosted.h:34:4: error: "This header is not available in freestanding mode."
   34 | # error "This header is not available in freestanding mode."
      | ^
In file included from /test/work/llvm-project/libc/src/fenv/fegetenv.cpp:10:
In file included from /test/work/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:17:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/math.h:36:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cmath:3716:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/specfun.h:47:
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/tr1/gamma.tcc:236:18: error: no member named '__throw_domain_error' in namespace 'std'; did you mean '__throw_runtime_error'?
  236 | std::__throw_domain_error(__N("Argument is nonpositive integer "
      | ~~~~~^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVluP2zYT_TX0y8CCROqyfvCDfFE-f_FuFo63SJ8EShpbTCjSJSk7eelvLyh5N5vNFn3oJUBRw9BlfHhmOJwzHm6tOCrEOUkWJFlNeO9abeZngcpNKt18mf9PELqEDfQWGzgYtC30Va9cT1hOWRDGUGvluFBoPFAo67iU2ABJw1pydQQpGzjW9TRiIEVlXVMTuiB0MY3YtMEzSUPgqgHtWjRQ9UI2YPCXXhjsUDkL3o4BCVckzHe9UkIdxxeShuPXtijlaKs7_glh-gbuhPrIgVBKaEyyxXb70215v3v3__VyX642O5KtCC2kPHeEUiDJclwOMF0tb_O363JZLt_d3m-26x1hq3Ejr6E-fPgON-7uGfoRvHjYbFfl_uf7NWGrHUrkFr8lHaJ8eL8ut5u7twOjT95zpgGxWhf5w3Zf7vPdm_W-3O8291vPSSj9fJOWaTw91VMpVP95elT9txu8Uqzv8sV2_ZiR98PibAyfLYb71Gkt7RQ_O8MJW0jZELY4aSm_EJr9LuHu4W6_uV1fCaWo6lfRY-Tvy_27MSuErT7cpCNG-ZN7ccLjq0HbS2dBKODgtAJ9gIOWUl-EOgIao42FS4tqLCNvHCJg-Qu6WiurJY7WjYKDkAhC1bJvhirXHRBaOLSO0OKizadrrUxPRn_E2lvHrRXW-OsB1Xm4HdGhOgf16URYHoVPnv8CH2Vp-9NJG_9Dcf_ghPQPa3XedCcZtN5f9sf-emtGYkKLY-15rxXzrFyKiBFaBMH3lysdocVVw4_gjrt2iIGlPyyG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