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

    <tr>
        <th>Summary</th>
        <td>
            Cannot include `<format>` with libstdc++
        </td>
    </tr>

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

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

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

<pre>
    The following valid translation unit

```cpp
#include <format>
```

causes clang with libstdc++ to fail with

```console
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/format:44:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/limits:1995:1: error: use of undeclared identifier '_Float128'
 1995 | __glibcxx_float_n(128)
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/limits:1903:27: note: expanded from macro '__glibcxx_float_n'
 1903 |     struct numeric_limits<_Float##BITSIZE>                              \
      | ^
<scratch space>:483:1: note: expanded from here
  483 | _Float128
      | ^
In file included from <source>:1:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:1281:24: error: unknown type name '_Float128'
 1281 |   using __float128_t = _Float128;
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:2857:2: error: unknown type name '__float128_t'
 2857 |         __float128_t _M_f128;
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:2862:22: error: member initializer '_M_none' does not name a non-static data member or base class
 2862 |       _Arg_value() : _M_none() { }
      | ^~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:2913:38: error: use of undeclared identifier '__float128_t'
 2913 |           else if constexpr (is_same_v<_Tp, __float128_t>)
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:2939:25: error: use of undeclared identifier '_M_handle'
 2939 | std::construct_at(&_M_handle, __v);
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:3109:38: error: use of undeclared identifier '_Float128'
 3109 |           else if constexpr (is_same_v<_Td, _Float128>)
      | ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:3110:37: error: no member named '__float128_t' in namespace 'std::__format'
 3110 | return type_identity<__format::__float128_t>();
      | ~~~~~~~~~~^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:3114:37: error: no member named '__float128_t' in namespace 'std::__format'
 3114 | return type_identity<__format::__float128_t>();
      | ~~~~~~~~~~^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/14.0.0/../../../../include/c++/14.0.0/format:3193:48: error: no member named '__float128_t' in namespace 'std::__format'
 3193 | else if constexpr (is_same_v<_Tp, __format::__float128_t>)
 |                                             ~~~~~~~~~~^
10 errors generated.
Compiler returned: 1
```

See it live: https://godbolt.org/z/5MGxzTYb4

@pranavk: This began with https://github.com/llvm/llvm-project/commit/457f582ffe23e951380bc345c4c96ec053c09681
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkmE2P4ygTxz8NuaCOMPj1kEM63Xk0hz5NX569WATKCTsYLMDpzBzms6-wnXQyk-ndXmlXaS2KYsu8Vf34U2XDvVdbA7BA2T3KHma8DzvrFpLvlfTBGphtrPy6eN4BbqzW9kWZLd5zrSQOjhuveVDW4N6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