<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65971>65971</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang/c++/coroutines] `-Wunused-parameter` not working with coroutines.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
no-more-secrets
</td>
</tr>
</table>
<pre>
Given some coroutine return type `task<T>`, the following:
```cpp
task<int> foo( int a ) {
co_return 42;
}
```
when compiled with `-Wunused-parameter`, will not warn that `a` is unused. I suspect that it is because `a` is used during setup of the coroutine frame/promise... but I think most users would not expect that to count as "used."
**Actual behavior**: no warning.
**Expected behavior**: `warning: unused parameter 'a' [-Wunused-parameter]` (when that warning is enabled)
Note that GCC _does_ warn in this scenario. In my coroutine-heavy code base I am thus forced to compile with GCC to find all of my unused parameters.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02P4zYM_TX0hYjh0F_JwYeZZLOYS08FehzIFh2rI0uGPiadf1_INjbbdgsINkiRj4-PovBe3Q1zB_Ur1NdMxDBZ1xl7mK3jg-fBcfBZb-VX9119skFvZ8bBOhuDMoyOQ3QGw9fCCE0RhP-A8vI7lN-gKYAuGCbG0WptH8rcoXyB4grFS7pcz7Asm2fPVCZA-Q1Ha4FOqExAgUBnhPZ1i0Mc7PtetSIodze0138hb-ZjYoODnRelWeJDhSnRPPwRTfQsD4twYubAbmf7UFqjsQEfInU1iZDCBTQFKo9bUo74hj76hYewhaiQbnseRPT8jwTPEmV0ytzRc4gL2nFV5CngmAgA3RZnZ-U5z3PsY8A3DJMyHzhbHxKM8_iwUcuVHP_1rB0sDjYmnTwC0UoQiHYxti-l8zKEKDT2PIlPZd3mhPIFjV27Veae_xz_bS3C8hcZ0BR7RrI2VfCHlAjUCqAWoX79hdD1NYkDdFpHs_awgyXF2IheswQ6_9zBbzbwFvr9csF3adm_byNSCUJ59AMb4ZRNwzE4fz0VPkwsPpMtGXvhGd9QzBim6HG0bmC5Sbi-kO2BpBrB4qiMRKF1mtn89Z82fZ7JrpTn8iwy7o7NuaqqEx2rbOraopGiGEquKlG347nt26Kqm5rlsWoKOmWqo4LK4nw8HpuiLKucJI_i1I9VJY5EgqAqeBZK51p_zrl190x5H7lr6nN7zLToWft1Z4kGLcw9TZwuQGT4gWto8tTXzHUJ4dDHu4eq0MoH_8QMKuh19XeM2wD0up7bD_k81Nf_XZltVaz7SNNbtXvm5Vl0uptCWHxae7oB3e4qTLHPBzsD3RKN_XdYnP2ThwB0W8l7oNva6t8BAAD__yZfevI">