https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123277
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:6dc335c506aca39af537180b2a0b23e640e5346e commit r16-6462-g6dc335c506aca39af537180b2a0b23e640e5346e Author: Jakub Jelinek <[email protected]> Date: Fri Jan 2 09:18:02 2026 +0100 c++: Fix up is_late_template_attribute for [[maybe_unused]] [PR123277] is_late_template_attribute wants to return false for gnu::unused, gnu::used and maybe_unused attributes, so that -Wunused-local-typedefs sees those attributes applied even to typedefs to dependent types. Before my recent r16-5937 change, for maybe_unused this happened to work through the lookup_attribute_spec returning NULL in that case because there is no gnu::maybe_unused attribute, but when that has been fixed, maybe_unused needs to be listed in the exceptions next to unused and used attributes. 2026-01-02 Jakub Jelinek <[email protected]> PR c++/123277 * decl2.cc (is_late_template_attribute): Return false also for [[maybe_unused]] attribute on TYPE_DECLs to dependent types. * g++.dg/warn/Wunused-local-typedefs-5.C: New test.
