https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82323
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- Martin, if you have free cycles please go ahead. I think other attributes might suffer from the same problem (alias and weakref). It doesn't look to me like it can be reliably detected in the attribute handler (because it doesn't necessarily know whether it's dealing with a definition or a declaration) so it might need to be done either in or analogously to diagnose_mismatched_attributes in c-family/c-warn.c.