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

    <tr>
        <th>Summary</th>
        <td>
            Error: implicit instantiation of template within its own definition
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/Pbj4rnsvW
GCC and MSVC accept this.

```cpp
template<int...> struct A {
        static constexpr auto x = []<int> { return A<>(); };
};

int main() {}
```

```
<source>:2:45: error: implicit instantiation of template 'A<>' within its own definition
    2 |         static constexpr auto x = []<int> { return A<>(); };
      | ^
1 error generated.
Compiler returned: 1
```

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysU0GLpDoQ_jXlpRiJiZr24MG223d68ODB7jnG2J1ZTSQpZ2bn1y_pnpldBvawsFJgQfJ99X1VFRWjvThjWqiOUJ0ytdPVh_asX0fzLRv99L29Em0RRAd8AD5c_DT6hXIfLsCHV-DDf-NjGVx8-gqs-6fvUbkJ__3_S49Ka7MR0tXGHFiXomb30NsGrCOzbosiA6K3jvI8B3HGSGHXhB2CPN5QTSRFVqP2LpJ52QKqnTy-IIgT3mXfCRIa5BGDoT047ED0IM7AD8AbEEcEeQJx4_xIWGcd4aqsu1-7FZWnX6V-Up5y0Ue_B20Su-g4iK6sQHRoQvAhJXbdFqstoXWRlCOryHqHfsZ3ywhcfgiU-Gzpah1aiuifHU5mts4mDLAOEZEjyB7fv7_ekDttKgHVGVhX3K3gxTgTFJkpza_362YXE97ozJScFp96k02tmBrRqMy0haw4k4dDU2XXth6lmWatJlGxuWZ1pWY18lrxSR1GwVlmW854xSRrilqUVZWXRtYH3WhdFGI28wglM6uyS74sT2vav8zGuJu2KKWUh2xRo1nibY85d-YZb6fAeVrr0CbQw7hfIpRssZHiTxqytJj2_AfD--24sj0snx-Mpes-5tqvwIdU8-33sAX_aDQBH25KI_DhzcpTy38EAAD__-juE54">