[Clang] Attributes to unnamed void parameter silently ignored (original) (raw)
Attributes that apply to parameters can be applied to the unnamed void parameter of a no-arg function
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.