commit dd0af86e2c58357e5aa83d9791e6bc6ae9c2a418
Author: Jason Merrill <jason@redhat.com>
Date: Tue Feb 14 17:25:35 2012 -0800
* parser.c (cp_parser_explicit_instantiation): Give a warning
for ignored attributes on explicit class instantiation.
@@ -13122,6 +13122,9 @@ cp_parser_explicit_instantiation (cp_parser* parser)
tree type;
type = check_tag_decl (&decl_specifiers);
+ if (decl_specifiers.attributes)
+ warning (OPT_Wattributes,
+ "attributes ignored on explicit type instantiation");
/* Turn access control back on for names used during
template instantiation. */
pop_deferring_access_checks ();
new file mode 100644
@@ -0,0 +1,5 @@
+template <class T> struct A { };
+
+template
+__attribute__ ((packed))
+struct A<int>; // { dg-warning "attributes ignored" }