Issue 108819
Summary [Clang] Attributes to unnamed `void` parameter silently ignored
Labels clang
Assignees
Reporter MitalAshok
    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.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to