2018-04-04 Jason Merrill <jason@redhat.com>
+ PR c++/84221 - bogus -Wunused with attribute and template.
+ * decl2.c (is_late_template_attribute): Handle unused and used
+ normally on non-TYPE_DECL.
+
PR c++/85135 - ICE with omitted template arguments.
* decl.c (grokdeclarator): Catch deduced class type in trailing
return type.
if (is_attribute_p ("weak", name))
return true;
- /* Attributes used and unused are applied directly, as they appertain to
- decls. */
- if (is_attribute_p ("unused", name)
- || is_attribute_p ("used", name))
+ /* Attributes used and unused are applied directly to typedefs for the
+ benefit of maybe_warn_unused_local_typedefs. */
+ if (TREE_CODE (decl) == TYPE_DECL
+ && (is_attribute_p ("unused", name)
+ || is_attribute_p ("used", name)))
return false;
/* Attribute tls_model wants to modify the symtab. */