<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/112132>112132</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            -Wall gives spurious "is not used" warning when expanding variadic capture and other pack
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Aster89
      </td>
    </tr>
</table>

<pre>
    ```cpp
auto foo(auto ...x) {
    return [...x = x](auto ...f) {
        (f(x), ...);
    };
}

int main() {
    foo(0)([](auto x){ return x; });
}
```
Compiling the code above via
```bash
clang++ -std=c++20 -Wall file.cpp
```
produces this spurious warning:
```none
file.cpp:2:16: warning: lambda capture 'x' is not used [-Wunused-lambda-capture]
    2 |     return [...x = x](auto ...f) {
 |                ^
file.cpp:8:5: note: in instantiation of function template specialization 'foo<int>' requested here
    8 | foo(0)([](auto x){ return x; });
      |     ^
1 warning generated.
```
---
```
$ clang++ --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2PszYQ_jXDZQSCcQjkwCHZvJF6r_QeKwMTcOvY1DbZtL--MiTZdHdPLYrC2PPMxzMfSO_VYJgbKA9QHhM5h9G6Zu8Du3qXtLb_q4Ftvv66aYL8CPlezsHi2VqgehGzLLsB7RCqwwpARHQcZmcQykNUI4gj3qA8vticv9jEB6g-A9XRIdBbxEVJvKCgOj7PUV6F5V-ZgBepDFD9xfmacL74rVe-j2SWYNXhkfMNxGGJ8hL4I9CjHOvxzV4mpZUZMIyMne0ZZWuvjFclPxm00o_rVaelGYAOQAdMfehBHLv1SDmmP6XWeFaas2fFPwWdnO3njj2GUXn00-yUnT2-S2eUGUDsP1kZa3i9eroVewKxL7Yg9i92qOWl7SV2cgqzYwSqbkAVKo_GBpw997Gj6c_ZRDld4ekdHiv6LDchVG_4nybhYfjyQPnjC4EaxL6MSRsbOL6VQWV8kCYoGZQ1aM94nk23yIEvk5aB0U_cKanV3ysGqIqTId6UCSB-RLaO_5zZB-5xZMcflOols_83R3c6d4ZPWsWjCTiwYScD99m3rU_T9Nt7oA3-a6zSKzuvrHmZOLxfYVFnRVavml-lGzjE8t3q7W_bTTp1qVZmvqWDme-Q0bHs8WJ71hE4Wa9uq-qXWG-tuT8qF1VAp9k7oFOrzKc8k74R_U7sZMJNUVFdk9iVlIwNtQVVVIuy2Oyq9ixE0Qlqy74simqzbfNENZTTpsgLUVBJgjLeda3krq22YlNV9RY2OV-k0pnW10tm3ZAo72duioIKQYmWLWu_fOOIDL_jogWi-MlzTTRK23nwsMm18sF_uAkqaG7WjRzUlV-WDYhetgKInh18H9kg3yZp-ni8Sqdkr7rnUknTow0jO5xk90cyO92MIUw-7i2dgE6DCuPcZp29AJ1iLvdXOjn7O3cB6LQw8ECnO8VrQ_8EAAD__xfIpFA">