PR c/35434
* c-common.c (handle_alias_attribute): Disallow attribute for
anything not a FUNCTION_DECL or VAR_DECL.
testsuite:
* gcc.dg/attr-alias-4.c: New test.
From-SVN: r143998
+2009-02-06 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/35434
+ * c-common.c (handle_alias_attribute): Disallow attribute for
+ anything not a FUNCTION_DECL or VAR_DECL.
+
2009-02-06 Janis Johnson <janis187@us.ibm.com>
PR c/39035
{
tree decl = *node;
- if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
+ if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+ else if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
|| (TREE_CODE (decl) != FUNCTION_DECL
&& TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
/* A static variable declaration is always a tentative definition,
+2009-02-06 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/35434
+ * gcc.dg/attr-alias-4.c: New test.
+
2009-02-06 Janis Johnson <janis187@us.ibm.com>
PR c/39035
--- /dev/null
+/* ICE on invalid alias attribute: PR 35434. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+typedef int i __attribute__((alias("j"))); /* { dg-warning "ignored" } */