<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117676>117676</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lambda: immediate function 'operator()<int>' used before it is defined
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Fedr
</td>
</tr>
</table>
<pre>
This C++23 program
```
#include <memory>
consteval auto func1() {
return std::make_unique<int>();
}
template <typename T>
consteval void func2() {
[](auto) -> void {
func1();
}(0);
}
int main() {
func2<int>();
}
```
is accepted by GCC, but Clang prints weird error:
```
error: immediate function 'operator()<int>' used before it is defined
9 | [](auto) -> void {
```
Online demo: https://gcc.godbolt.org/z/Kb8M7c3nb
Original discussion: https://stackoverflow.com/q/79221393/7325599
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysk0GPqzYUhX_NZXM1EVwnOCxYJLxHF1X1Nm9fGXxD3DE2Y5uM0l9fOcl0ZjpS1UUREghz7vnOsaxiNJNjbmF3hN23Qq3p7EPbsw7F4PW1_Xk2ETugI9CRBC7BT0HNUB6gLh93eQASxo121YwguplnH64gvueV8jB6FxNflEW1Jo-n1Y0V0B6oQZBHKA-IiIHTGhzGpEEcQBxm9cy_r868rAyiMy7lcTcRiKwB-e0-PfG8WJVuxum6sFMz48-7-bvzxRt9c6YvzvfgQPtMl5eeQHy_C95_ytcH8DvDTS2ztPzKZVzCWRn32e-O8C-BPpRqIqpx5CWxxuGKv3QdUIfDmrCzyk24BONSxFc2QSOH4EOu7vOMt89o5pm1yT1lhGS8QyDpFw4q-fAG8jeXxDVmWz75wGgSmoiaT8axfgTPkTr8TwV-BPrhrHGMmmefsc4pLTFjUw_UT-O4mbwevE0bHyag_k-g_tdh_5schRvuxf4IZjJOWdQmjmuMxruvk2JS47O_cDhZ_7oZ_QzUvwD1siGqRCPyq6DdrmkK3QrdiEYV3FZSUF1uqa6Lc8tc7UZSOzHo5iTLWgjFJ1E1WupmP1Z1YVoqaVtVVJf1Tm7rTUV1fZJyP-6V1pWsYVvyrIzdWHuZc6DCxLhyW1WylnVh1cA23g4ekeNXvK0CUT6Hoc2ip2GdImxLa2KK72OSSZZbq-ZBq_93c4s12PYfm2LSeR0eHWaEx-NpCf4PHhNQfwOPQP0j2aWlvwIAAP__fyRGhA">