https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120010
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Common-Type-Attributes.html#index-unused-type-attribute "This is often the case with lock or thread classes, which are usually defined and then not referenced, but contain constructors and destructors that have nontrivial bookkeeping functions." It should just mention only applies to non-parameters. Because for parameters you can omit the name and it will work (in both GNU C [C23+] and C++).