+2004-11-30 James A. Morrison <phython@gcc.gnu.org>
+
+ PR middle-end/18596
+ * c-decl.c (grokdeclarator): Reset DECL_INTIAL to error_mark_node
+ on errors.
+
2004-11-30 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (expand_expr_real_1, case NOP_EXPR): Properly handle
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
+ decl = build_decl (FUNCTION_DECL, declarator->u.id, type);
+ decl = build_decl_attribute_variant (decl, decl_attr);
+
if (storage_class == csc_register || threadp)
- error ("invalid storage class for function %qs", name);
+ {
+ error ("invalid storage class for function %qs", name);
+ if (DECL_INITIAL (decl) != NULL_TREE)
+ DECL_INITIAL (decl) = error_mark_node;
+ }
else if (current_scope != file_scope)
{
/* Function declaration not at file scope. Storage
pedwarn ("invalid storage class for function %qs", name);
}
if (storage_class == csc_static)
- error ("invalid storage class for function %qs", name);
+ {
+ error ("invalid storage class for function %qs", name);
+ if (DECL_INITIAL (decl) != NULL_TREE)
+ DECL_INITIAL (decl) = error_mark_node;
+ }
}
- decl = build_decl (FUNCTION_DECL, declarator->u.id, type);
- decl = build_decl_attribute_variant (decl, decl_attr);
-
DECL_LANG_SPECIFIC (decl) = GGC_CNEW (struct lang_decl);
if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))