https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55203
--- Comment #17 from Marc Glisse <glisse at gcc dot gnu.org> --- I wonder if attributes unused / warn_unused should be automatically inherited by classes when a member or base has it (with various rules, maybe unused has priority over warn_unused). For a tuple of locks or a tuple of strings, that seems to do the right thing. For a class that contains a private internal lock, the user might need to specify warn_unused so the compiler does not guess "unused" instead. Even if that's currently useless, I still believe that decorating the relevant classes (locks, etc) with attribute unused would be good (it could be used by external tools as well).