<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62611>62611</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
generic lambda in tparam list is uncallable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ericniebler
</td>
</tr>
</table>
<pre>
Compile with `-std=c++20`:
```c++
template <auto A = [](auto x){}>
struct C {
static constexpr auto B = A;
};
int main() {
C<>::B(42);
}
```
result:
```
<source>:8:3: error: no matching function for call to object of type 'const (lambda at <source>:2:20)'
C<>::B(42);
^~~~~~
<source>:2:20: note: candidate template ignored: couldn't infer template argument 'x:auto'
template <auto A = [](auto x){}>
^
1 error generated.
```
I can't fathom why the compiler cannot infer the type of the lambda argument.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU92O8ygMfRrnxpqKQhPSi1yk7VTaxyDESVgRqIDszNzss69I2pnu9yt9UVsaY47P8TEqRjM6ogbKE5SXQi1p8qGhYLQz1FkKRef7j-bs55uxhG8mTQgVe4mpB3HRwE_AT5xBxUC0wC7AHr8V2z73nC2aaL5ZlQhBnNWSPLYI4oJbdeD1GnsHfgR5AnkB8bqdiyksOuEZc3yNIMakktGovYuJ3m8B18OnFbAFcc9bUU7PzIxLOCvjgNfAj0-IZxDnXFG0INoT8PrAM5NnpP9Le0YNFBebftaE-6s4R78ETVuVGkQrQLRIIfiQ_ziPs0p6Mm7EYXE6Ge9w8AG1shaTR9_9TTqhHzB93AiBy1U-Aq-tmrteoUr4TRmevywr4fLRu99IRYTy9d_8_JD4HXElnCivWrne9NnYT4fN6Hygft31i-0dcJnQuIHCV5IK4zKTywLkO4g2W_hJ80-HBb9_oLzv7bdm40iOgkrU737h6V9Z10p7UGnyM75NH5gmQr1dh-yLc_5T1USbLdmeifDhyF3jrugb0R_FURXU7KtalDUXlSymptSDHMqS2J5xIStZSl13nTgwxXTXya4wDWdcsJLVfH-omNzJnLgvuSTdDwfZwYHRrIzdWfvPvPNhLEyMCzUVr_b7wqqObFzvOOeO3nDdBM7zlQ9NPvPSLWOEA7MmpviFkkyy1KzNMvohyDhMNxXUjDkbTcTF5QFVnaViCbaZUrrFPFv8Cvw6mjQt3U77Gfg1I9-Xl1vweZqBX1c-Efh15ftfAAAA___S0FJL">