<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113792>113792</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Templated lambda ends up with dependent type in C++11
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tbaederr
</td>
</tr>
</table>
<pre>
This is an issue for the bug from https://github.com/llvm/llvm-project/pull/108598
This code:
```c++
template<typename T>
constexpr T outer() {
return []<T x>() { return x; }.template operator()<123>();
}
static_assert(outer<int>() == 123);
```
ends up with a dependent type that we assert on in codegen.
This starts when we deduce the type of the call operator, which is dependent in C++11 but `auto` in later versions:
https://github.com/llvm/llvm-project/blob/7b88e7530d4329ff0c7c8638f69b39fa1e540218/clang/lib/Sema/SemaType.cpp#L958-L973
and we never seem to clean this up.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02v6ygM_TXOxnoVgeZrkcW97XT1dtP9iASnYUQhAud-_PsRSe99nZnVk1BAYJ-Tc2zrlOzNE_VQvUJ1LvTKc4g9D5oMxVgMwXz219kmtAm1R5vSSjiFiDwTDusNpxjuODMvCdQLyAvIy83yvA6HMdxBXpx7-9p-LDH8TSODvCyrcyAvpWirrgVxBvGyfzeuMRjKaPt9LfY1gnzNa7tlui9OM4E68edCXt8Jr6D-2F_H4BPTxxLximFliiBbkB1C80hHjMRr9LjrBnW64kdO_477CvgA9YrQnA9fjBgWiprDAxPUqZTqOxXUgwGa835IrNmOf-mUKDLIdv8fdbKenwjVGdQZM9Izxpf0Z4fIm4Trgu-WZ9RoaCFvyDNmH5BnzfhOuNNh8Gj95ueN_OF_RifWkRO-z-RzkiGzjrSVdgML03YetXNPqk_4Pttxzh3xi9x6PO31KUscVkaohV45QC3yWzYu4hvFZINP37X97b4ZXBhAXpqhbamplDBHJbtpEmMztrVqp7obVDfpkqqjkGUL8jI67W8ZyObEP-muH9v1c6HDuCwg1c-uan_87Br1bJD2Jnvi6Y0iJqI7csDRkfbI2bt1ORSmV6ZTnS6oLxslhKhU2RRzL6npdG0UKU2ik3qqylrXQ1OJksr22BW2l0IeSyEbUYmyag7V0TS1GLqjopIabeAo6K6tO2QDDiHeim30-rJUTScLpwdyaZtaKXeJ6mWKwTN5A1LmWY79Zt6w3hIchbOJ0y80tuyovz562qDT98Fo_Fdz_ae1nktcrNH1v129TULKc7-reOvlPwEAAP__bnxgvA">