<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63880>63880</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unary `*` or `&` applied to immediately invoked lambda passed to constructor cast parsed as decomposition group
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ecatmur
</td>
</tr>
</table>
<pre>
Since 11.0.0,
```c++
int main() { int(*[] { return new int; }()); }
```
```
<source>:2:20: warning: ISO C++17 does not allow a decomposition group to be empty [-Wempty-decomposition]
int main() { int(*[] { return new int; }()); }
^
<source>:2:22: error: expected ')'
int main() { int(*[] { return new int; }()); }
^
<source>:2:17: note: to match this '('
int main() { int(*[] { return new int; }()); }
^
<source>:2:19: warning: decomposition declarations are a C++17 extension [-Wc++17-extensions]
int main() { int(*[] { return new int; }()); }
^~
<source>:2:19: error: decomposition declaration cannot be declared with type 'int (*)'; declared type must be 'auto' or reference to 'auto'
<source>:2:19: error: decomposition declaration '[]' requires an initializer
```
And, similarly,
```c++
struct S { S(...); void f(); };
int main() { S(&[]() -> int& { return *new int; }()).f(); }
```
```
<source>:2:20: error: expected unqualified-id
int main() { S(&[]() -> int& { return *new int; }()).f(); }
^
<source>:2:22: error: expected ')'
int main() { S(&[]() -> int& { return *new int; }()).f(); }
^
<source>:2:15: note: to match this '('
int main() { S(&[]() -> int& { return *new int; }()).f(); }
^
```
Possibly related to https://github.com/llvm/llvm-project/issues/35570 ?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVk1v4zYQ_TXUZWBBokzLPuhgJzHQUwsYRc8jamyzpUgtSSXrHvrbC1LOOtm104-FW4GW-Kl5b-b5Qei9OhiihokNE48ZjuFoXUMSQz-6rLXdqdkpIwnKMi_ygvEHVjyyYs0WxdQk45vY0qwyAXpUhvEl4ytg9QaUCWm0niKkOUdhdAYMvaTlagOsfpzOxHYev49zfVg9eDs6Sax6YtWax1_BqjW8oDPKHGL3h92P8DCBLGvoLHkwNgBqbV8AoSNp-8F6FZQ1cHB2HCBYaAmoH8IJmNjMfknd2butTDzeizN8ezHxdJtxvAE5Z13qfB5IBuqA8Tq9vL4bzo9QlXUEY2yg-AwWegzyCOGo_IRseU9k_yB95eorwbxXREdSo8PY94COAN-oiT4HMj5uSzKRrwuzLwv-njph4umPv-D1RRY3WYFEE_8QLZ1nqYMXFY4QTgPFUkXgZ5iTnKrNZWfa1I8-nWe8xjFYxmuwDhztyVH0jmDfLH0_4PiSlLAYyNGnUTnygAaUUUGhVr-Tu24X6b42HeMP4FWvNDp9unjaB87mgxtlgF2q0Y7xZZ7n53o8W9XB_lyic32q24a4S_3FK4M0P2PV06SGxVsRML6-oYP8q3i32f5dx_zWP0bzaUSt9oq6mer-Bz53cr07Ar52feg94ntM8r8icmFwTWA_We9Vq0_gSGOsQLBwDGHwrFozvmV8e1DhOLa5tD3jW62fXx-zwdlfSQbGt8r7kTzj20qIugBWbbOuqbpVtcKMmnKxXM2Loqrn2bHhWJaL-Z4vqSxWK5TzlmTFUSJvqRS1yFTDC14VdSkKIbiY53uxXLWi5YLX7bwkweYF9ah0HkHk1h2yFL5ZVMtlkWlsSfvXDyLXJKTtePBsXmjlg78cCypoan426E4Qs8JjhqL1pcEiDnAYtJqSovqeOoWB9AmUeba_UQca-7ZDGND7aZO0ZrIa60CiDzCgi0vor32pZKPTzb9PdiL8ZwAAAP__dfG_pA">