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

    <tr>
        <th>Summary</th>
        <td>
            Clang is missing GCC builtins necessary to work with recent libstdc++
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Trying to use trunk Clang with the current trunk libstdc++ and including pretty much any header (e.g. `<cmath>`) results in errors like these:

```cpp
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/cmath:3701:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/specfun.h:44:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/limits:2125:16: error: use of undeclared identifier '__builtin_huge_valq'
 2125 |       { return __builtin_huge_valq(); }
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/limits:2129:16: error: use of undeclared identifier '__builtin_nanq'
 2129 |       { return __builtin_nanq(""); }
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/limits:2133:16: error: use of undeclared identifier '__builtin_nansq'
 2133 |       { return __builtin_nansq(""); }
      |                ^
3 errors generated.
Compiler returned: 1
```

(see also [on Godbolt](https://godbolt.org/z/4qr3bbrMd))

I don't know if this might also be considered a bug in GCC itself, but I'd say Clang might as well just implement the builtins if libstdc++ wants to use them.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUlktv2zgQxz8NfRlYkElZj4MOsVMFOexls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