* tree.c (handle_dll_attribute): Return early if not a
var or function decl.
testsuite
* gcc.dg/attr-invalid.c: Add tests for invalid dllimport.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116270
138bc75d-0d04-0410-961f-
82ee72b054a4
+006-08-20 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/28648 c:
+ * tree.c (handle_dll_attribute): Return early if not a
+ var or function decl.
+
2006-08-18 Joseph Myers <joseph@codesourcery.com>
PR target/27565
+2006-08-20 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/28648 c:
+ * gcc.dg/attr-invalid.c: Add tests for invalid dllimport.
+
2006-08-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28630
{ return 0; }
int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
+
+
+/* PR target/28648 */
+/* These are invalid on all targets. Applying to PARM_ or FIELD_DECL
+ also caused a tree checking ice on targets that support dllimport. */
+#undef AT
+#define AT dllimport
+
+typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+struct ATSYM(struct) {
+ char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
+};
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute ignored" "" } */
+{ return 0; }
+
+int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
return NULL_TREE;
}
+ if (TREE_CODE (node) != FUNCTION_DECL
+ && TREE_CODE (node) != VAR_DECL)
+ {
+ *no_add_attrs = true;
+ warning (OPT_Wattributes, "%qs attribute ignored",
+ IDENTIFIER_POINTER (name));
+ return NULL_TREE;
+ }
+
/* Report error on dllimport ambiguities seen now before they cause
any damage. */
- if (is_attribute_p ("dllimport", name))
+ else if (is_attribute_p ("dllimport", name))
{
/* Honor any target-specific overrides. */
if (!targetm.valid_dllimport_attribute_p (node))