parser.c (cp_parser_explicit_instantiation): Give a warning for ignored attributes on explicit class instantiation.

* parser.c (cp_parser_explicit_instantiation): Give a warning
	for ignored attributes on explicit class instantiation.

From-SVN: r184254
This commit is contained in:
Jason Merrill 2012-02-14 20:56:56 -05:00 committed by Jason Merrill
parent aa434b3d4d
commit 7f3dee0e1c
4 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-02-14 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_explicit_instantiation): Give a warning
for ignored attributes on explicit class instantiation.
2012-02-14 Jakub Jelinek <jakub@redhat.com>
PR c++/52247

View File

@ -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 ();

View File

@ -1,3 +1,7 @@
2012-02-14 Jason Merrill <jason@redhat.com>
* g++.dg/ext/attrib43.C: New.
2012-02-14 Hans-Peter Nilsson <hp@axis.com>
* lib/target-supports.exp (check_effective_target_fgnu_tm): New

View File

@ -0,0 +1,5 @@
template <class T> struct A { };
template
__attribute__ ((packed))
struct A<int>; // { dg-warning "attributes ignored" }