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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Attributes to unnamed `void` parameter silently ignored
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Attributes that apply to parameters can be applied to the unnamed `void` parameter of a no-arg function

```c++
void f1([[maybe_unused]] void) {}
void f2([[clang::lifetimebound]] void) {}
void f3([[clang::annotate("category1", "foo", 1)]] void) {}
void f4(inout void) {}  // In HLSL
```

And also others. None of these attributes seem to have any effect. `f3` is the only one that could have an effect, but it seems to be discarded anyways.

Standard attributes may be forced to be accepted, since that `void` is formally an unnamed parameter (in both C and C++), so is technically a declaration, and `[[maybe_unsued]]` applies to declarations.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyElM2u8jYQhq_G2YwOSmwSyCILfoRa6Ws35wKqiT1J3Do2sh2q3H1lA4UeVd-RIhA47zt_zxhD0KMl6lh9ZPW5wCVOzne_6YjmECb3V9E7tXaHGL3ul0gB4oQR8Ho1K0QHV_Q4UyQfQKKFnvKRJpUO40SwWIszKWBNeXNasaZ8acANgGDdB_oRhsXKqJ1l5ZmVh8dnU94fyfgxPfnf5ANDxfg-J32cce3pj8UugRSrz6w-Qw7FW2C7I9ud32X8X5k0aEcmDkwcjB4o6pl6t9jvLcT_WaC1LmKkdMa5xEij82vFOGf8BIzzwbnHj4rx9tsgW8b32rolfnkHgPEL4xf41cIvPz5_fGnUe_cOVgGa4MDFiXzYwO_OUup5nCgQ4GumgWhOA5vwRoB2BRoGknGTpjaINDMd8jSdNSskl0yBdItRT9FDkwrslwg6ZteQbHsCpYNEr0gl-79xDZv3TD8jWoVevec045qEg_PyTlNiS0q6RlIpSNBWPvJ4Y0uHpJjRmDXl9KTvhVxuK_QuTnACtApOD7R4m11dLpXkZLW8u4AiadBjhpPfRanT_2EvLE_2Uhb3Hci1v4mfNReqE6oVLRbUVTvebPet2O-KqasGIXZ91VS1lGqLfVm1ohWy5arpedPUhe54ybdlWzUV56IUm74WrVC1aOq23g-qZduSZtRmY8xt3jg_FjqEhbqq3O-rtjDYkwl51zm_w8t5WnvfJcFHv4yBbUujQwwvi6ijyRfEKSvqM7xfB-7nKx60IRvNCnq0zpMqFm-6KcZrSHuTUR51nJZ-I93M-CVFfXx9XL37MyN1yVUExi-PQm4d_ycAAP__ddZ58Q">