<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57193>57193</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
decltype in template lambdas crashes the clang++
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
OgnianM
</td>
</tr>
</table>
<pre>
`
template<typename T>
decltype(T::z) doesnt_crash(T& v) {
decltype(v.z) i = 0;
i += v.z;
return i;
}
int main() {
struct test {
int z;
};
auto crashes = []<typename T>(test& t) {
vector<decltype(t.z)> v;
return v;
};
auto also_crashes = []<typename T>(T& t) {
vector<decltype(t.z)> v;
return v;
};
auto no_crash = [](test& t) {
vector<decltype(t.z)> v;
return v;
};
test t{5};
doesnt_crash(t);
no_crash(t);
crashes.operator()<void>(t);
also_crashes(t);
}`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFU02P2yAQ_TX4gmphiBP74MOm6d6qXva-wmZqUxE7grGr7a_vQJKNszm0t0VINrz5eDO8aSfz1rCtYOLAxBPC8eQ0AlNf8e0Eoz4Cf2Hq2xk10Ll4zWRFl0-0_zBZczNBGPG18zoMCZJbvkSA7fZnR05r5bzkyc9ypg5cMHWxutkSIvcRjJZqFcQDzn7k9uazO6yd7Yj8qO1ISR4IBPRzhxwh4D2QMpLjfaoY-Z7ZDdMzTjzVCyEVwco9Kw8PXZNVzBb7gQ904lqgw8mT26o5mJpD3tRD9cH-Uv7yD6LvFLUL0-t_8Xz5PJLjheKa4Cc2LukDKWO5xpOC73WOKdsKvxbyEbtZXJ4in07gdSwgyZTKWCZrLoL5GHX9hg-RieFWZNAU263YqU0tisw0ytSq1hladNBcG0QK59fp5k4fW6PDu4RxAN45PfZx7OQ-m71rBsRTiFMun2n3Foe5zbvpSAfnluvny8lPv-gx6GhDmCPF53JX1CobKDV0bVnVG113rVCVgZ9FBaIwUFV1JcrM6RZcaOKbSznCb55C0D9JILONFFKKqtgVRVEKkRemrkDVrZKlMEVn2EYAzbrLI4988n3mm0SpnftAoLMBww3UIdh-BGjOEstIe8Pkmx_9aPX4PUupm0T9Lw33ZPk">