PR fortran/33152
* decl.c (add_init_expr_to_sym): Remove error message.
* resolve.c (check_data_variable): Add new check for a data variable
that has an array spec, but no ref and issue an error.
* match.c (gfc_match_common): Remove error message.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130415
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-11-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/33152
+ * decl.c (add_init_expr_to_sym): Remove error message.
+ * resolve.c (check_data_variable): Add new check for a data variable
+ that has an array spec, but no ref and issue an error.
+ * match.c (gfc_match_common): Remove error message.
+
2007-11-25 Tobias Burnus <burnus@net-b.de>
PR fortran/34079
return FAILURE;
}
- if (attr.in_common
- && !attr.data
- && *initp != NULL)
- {
- gfc_error ("Initializer not allowed for COMMON variable '%s' at %C",
- sym->name);
- return FAILURE;
- }
-
if (init == NULL)
{
/* An initializer is required for PARAMETER declarations. */
goto cleanup;
}
- if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
- goto cleanup;
-
- if (sym->value != NULL && sym->value->expr_type != EXPR_NULL
- && (name[0] == '\0' || !sym->attr.data))
- {
- if (name[0] == '\0')
- gfc_error ("Previously initialized symbol '%s' in "
- "blank COMMON block at %C", sym->name);
- else
- gfc_error ("Previously initialized symbol '%s' in "
- "COMMON block '%s' at %C", sym->name, name);
- goto cleanup;
- }
-
if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
e->symtree->n.sym->name, &e->symtree->n.sym->declared_at);
}
+ if (e->ref == NULL && e->symtree->n.sym->as)
+ {
+ gfc_error ("DATA array '%s' at %L must be specified in a previous"
+ " declaration", e->symtree->n.sym->name, where);
+ return FAILURE;
+ }
+
if (e->rank == 0)
{
mpz_init_set_ui (size, 1);