<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67492>67492</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLVM 17 regression: `variable 'test' cannot be implicitly captured` variable is not referenced in lambda
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MichielDerhaeg
</td>
</tr>
</table>
<pre>
Clang fatal errors with the following error: `error: variable 'test' cannot be implicitly captured in a lambda with no capture-default specified` even though the variable is not referenced anywhere in the lambda.
Minimal reproducing input:
```cpp
void foo() {
constexpr auto test = 42;
auto lambda = (test, []() noexcept(true) {});
}
```
* `test` needs to be `constexpr`
* The lambda expression needs to be a parameter to an expression. It doesn't reproduce if the lambda expression is assigned a to a variable first.
* `test` needs to be passed as a parameter to the same expression.
* The `noexcept` specifier needs any expression. Passing no expression does not reproduce. Just `noexcept` does not reproduce even though it should be semantically equivalent.
Git bisect has shown this commit to be the culprit: 93d7002dc4644b0a6f15a998dff0d55c72012e87
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4zYM_TXKhZhAkb8PPuxukKLFDtBD0bss0TYLWXIlOdn8-0Kxx5O0QNECg0kiku_xkQ-UIdBgEVtWfGXF-SCXODrfvpMaCc0Z_ShxOHRO39tvRtoBehmlAfTe-QA3iiPEEaF3xrgb2WGNsOwLsJLv36_Sk-wMAhNVxBCZqEBJa12EDoGm2ZCiaO6g5BwXjxrIggQjp07LlcW6j-Cbxl4uJkKYUVFPqFnJAa9oIY5uGdaOdkoKkHg89ujRKtQg7f02osdEklJXmiPjZ8a_rP_fydIkDXicvdOLSsrIzktk2ZbBSr7-qXleX66ONPTOMVEz0QCrvq7vAMrZEPHH7EEu0UGaALDsDLlg2Z70CG2KU5CJeh3VN1h3s-Fahz8UzjHF_YIfVNWZiWaHSz9f23xWB8DEY0EPgpKDRdQBokvbSJI--t3rHgW_7bOCFMQQyNmXWgmz9HLCiD69SPuUeISfI2iHwSYT7JNFoP5pC8_IFGCzpwb5wPvcak8-xON_kDPLEFJ9-HtziTPICZ9bfMZLalnJ93GXfDec3xikvb8I_DW1a4fk1ScZSfNmwU3yEX5ZkgVe0f-Z92JqihBGtxidVAWcpI2kpDF3wD8XukqDNr54-CeK0FFAFWGUIRXfEhgFUG6aKG4DSnNQi5k9JXNDk-mKc6FVXuZ5x2XZnwrZNLXue66LQlWCnwTW1TPTQbeZbrJGHrA9lU1RlXlenA5j2xSIddmpTukeM64LXpeyK-uuqguhhTpQK7jIeCNKccp5cTpKJWoUqtZVXuZZV7Oc4yTJHI25TkfnhwOFsGBbVnkjDkZ2aMLjdglh8QaPIBMinTLfppq3bhkCy7mhEMMnSqRosP3-_fd3OFXgcdi2tV2u_32w0gL_5eSQ3fx9WLxpxxjnkC6JuDBxGSiOS3dUbmLikhrcPt5m7_5AFZm4PGQFJi4P2X8FAAD__03720E">