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

    <tr>
        <th>Summary</th>
        <td>
            C++23 #include <format> from libstdc++ fails with "variable template ... cannot appear in its own initializer"
        </td>
    </tr>

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

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

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

<pre>
    Apparently since <https://github.com/llvm/llvm-project/commit/91f1830cb69cab96201adba6378d64095e251f95> "[Clang][Sema] Handle invalid variable template specialization whose type depends on itself (https://github.com/llvm/llvm-project/pull/134522)":  At least when building agaisnt `libstdc++-devel-15.1.1-1.fc42.x86_64`,
```
$ cat test.cc
#include <format>
```
```
$ clang++ -std=c++23 -fsyntax-only test.cc
In file included from test.cc:1:
/usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/format:5165:7: error: variable template 'format_kind' declared with deduced type 'const auto' cannot appear in its own initializer
 5165 |       format_kind<_Rg> // you can specialize this for non-const input ranges
      |       ^
1 error generated.
```
(where the` relevant contents of `/usr/include/c++/15/format` is
```
  template<typename _Rg>
    constexpr auto format_kind =
    __primary_template_not_defined(
 format_kind<_Rg> // you can specialize this for non-const input ranges
 );
```
).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVF2vszYT_DWbm1UQtoGECy7y8UTve9v-gMjYC3FrDLJNctJfXxnOV89R1T5SUZRYwd7ZGc-ODMH0jqiB8gjleSPneBt9E2JLvh-kc5t21M_mME3Sk4v2icE4RQjidItxCiAOwC_AL72Jt7nN1DgAv1h7f_vZTn78jVQEflHjMJi0qFnH9iJXbVUr2dYVz5nUrazEbq-rIq9L4iXr6hLEDwTOoTyerHQ9lGcoj7_SIKE84_-k05bQuLu0RuNdeiNbSxhpmKyMhGEiZaQ1f8hoRoeP2xgI43Mi1D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