aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-02-14 20:56:56 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-02-14 20:56:56 -0500
commit7f3dee0e1cd3024cef687846f55b5981dccce926 (patch)
tree2ff090482c7791f4e0e240972d28dae38339298b
parentaa434b3d4dfc229b4acc6b5604d68a44b2b9ed5a (diff)
downloadgcc-7f3dee0e1cd3024cef687846f55b5981dccce926.zip
gcc-7f3dee0e1cd3024cef687846f55b5981dccce926.tar.gz
gcc-7f3dee0e1cd3024cef687846f55b5981dccce926.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib43.C5
4 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f7cafec..864b6d3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 491f48e..3e2be97 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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 ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1a583e5..a7963aa 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/ext/attrib43.C b/gcc/testsuite/g++.dg/ext/attrib43.C
new file mode 100644
index 0000000..fe9f072
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib43.C
@@ -0,0 +1,5 @@
+template <class T> struct A { };
+
+template
+__attribute__ ((packed))
+struct A<int>; // { dg-warning "attributes ignored" }