aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2008-01-23 00:11:58 -0500
committerJason Merrill <jason@gcc.gnu.org>2008-01-23 00:11:58 -0500
commitb2a7def5aba4da7615a1ea9ea79e869da76f13c6 (patch)
tree1dfbc47f25968e7460e50b79ca7cbd5dcdc52fea /gcc/cp
parent62b445b31ccbd4c9a5d3e32c2863eb02c1ff3e2f (diff)
downloadgcc-b2a7def5aba4da7615a1ea9ea79e869da76f13c6.zip
gcc-b2a7def5aba4da7615a1ea9ea79e869da76f13c6.tar.gz
gcc-b2a7def5aba4da7615a1ea9ea79e869da76f13c6.tar.bz2
re PR c++/28560 (Trouble with __attribute__ in template parameter)
PR c++/28560 * decl.c (groktypename): Also ignore attributes on dependent possibly-class types. From-SVN: r131755
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f9971d4..667f813 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -9,6 +9,10 @@
2008-01-22 Jason Merrill <jason@redhat.com>
+ PR c++/28560
+ * decl.c (groktypename): Also ignore attributes on dependent
+ possibly-class types.
+
PR c++/34912
* friend.c (do_friend): Check for prior declaration of a friend
function of a local class.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 338e1ed..4640adf 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3908,8 +3908,12 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
if (attrs)
{
if (CLASS_TYPE_P (type))
- warning (OPT_Wattributes, "ignoring attributes applied to class type "
- "outside of definition");
+ warning (OPT_Wattributes, "ignoring attributes applied to class type %qT "
+ "outside of definition", type);
+ else if (IS_AGGR_TYPE (type))
+ /* A template type parameter or other dependent type. */
+ warning (OPT_Wattributes, "ignoring attributes applied to dependent "
+ "type %qT without an associated declaration", type);
else
cplus_decl_attributes (&type, attrs, 0);
}