aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2007-08-28 09:57:09 -0400
committerJason Merrill <jason@gcc.gnu.org>2007-08-28 09:57:09 -0400
commitc206a697018f0d9b5da08acb4585bc64aa1cb8e3 (patch)
treed3c91b2a9bed6196c94235a41d63153e044d54cf /gcc/cp
parent1c445f037f02fcf3e52e1b2cbc80aa38a5c93fd4 (diff)
downloadgcc-c206a697018f0d9b5da08acb4585bc64aa1cb8e3.zip
gcc-c206a697018f0d9b5da08acb4585bc64aa1cb8e3.tar.gz
gcc-c206a697018f0d9b5da08acb4585bc64aa1cb8e3.tar.bz2
re PR c++/28558 (Trouble with __attribute__ and non-PODs)
PR c++/28558 * cp/decl.c (groktypename): Ignore attributes applied to class type. * testsuite/g++.dg/ext/attrib28.C: New test. From-SVN: r127859
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a6222fa..03d6b51 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/28558
+ * decl.c (groktypename): Ignore attributes applied to class type.
+
2007-08-28 Richard Guenther <rguenther@suse.de>
* decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fdccb35..3117a7a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3877,7 +3877,13 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
type_specifiers->attributes = NULL_TREE;
type = grokdeclarator (declarator, type_specifiers, TYPENAME, 0, &attrs);
if (attrs)
- cplus_decl_attributes (&type, attrs, 0);
+ {
+ if (CLASS_TYPE_P (type))
+ warning (OPT_Wattributes, "ignoring attributes applied to class type "
+ "outside of definition");
+ else
+ cplus_decl_attributes (&type, attrs, 0);
+ }
return type;
}