https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91382
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, this seems like a case that should be ignored. We have -Wunknown-attributes that *doesn't* ignore them, but the main use of that is to catch typos in the attribute name, or warn about unsupported attributes (in case the code relies on it working). In this case it's a supported attribute that is spelled correctly, so silently accepting it seems fine. In the particular case of maybe_unused its purpose is to suppress diagnostics, so potentially giving extra diagnostics has the opposite effect! And if the concern is portability to older pre-C++17 compilers, the worst case scenario if this attribute is not recognized is an unused variable warning.