summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-06 20:05:12 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-06 20:05:12 +0000
commitc8df3e9ccbe09ae750aa04482db2dfa8a6687cea (patch)
treecf705dd04dbbcc1d3afb58821a83148e48c5ea47 /gcc/fortran/decl.c
parent776a1f2d0f4643b65f0470ae3402daf2272ed48d (diff)
downloadppe42-gcc-c8df3e9ccbe09ae750aa04482db2dfa8a6687cea.tar.gz
ppe42-gcc-c8df3e9ccbe09ae750aa04482db2dfa8a6687cea.zip
2005-11-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24534 * resolve.c (resolve_symbol): Exclude case of PRIVATE declared within derived type from error associated with PRIVATE type components within derived type. PR fortran/20838 PR fortran/20840 * gfortran.h: Add prototype for gfc_has_vector_index. * io.c (gfc_resolve_dt): Error if internal unit has a vector index. * expr.c (gfc_has_vector_index): New function to check if any of the array references of an expression have vector inidices. (gfc_check_pointer_assign): Error if internal unit has a vector index. PR fortran/17737 * data.c (gfc_assign_data_value): Remove gcc_assert that caused the ICE and replace by a standard dependent warning/error if overwriting an existing initialization. * decl.c (gfc_data_variable): Remove old error for already initialized variable and the unused error check for common block variables. Add error for hots associated variable and standard dependent error for common block variables, outside of blockdata. * symbol.c (check_conflict): Add constraints for DATA statement. 2005-11-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/24534 gfortran.dg/private_type_2.f90: Modified to check that case with PRIVATE declaration within derived type is accepted. PR fortran/20838 gfortran.dg/pointer_assign_1.f90: New test. PR fortran/20840 * gfortran.dg/arrayio_0.f90: New test. PR fortran/17737 gfortran.dg/data_initialized.f90: New test. gfortran.dg/data_constraints_1.f90: New test. gfortran.dg/data_constraints_2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106567 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index aaad320971b..8352c527461 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -203,24 +203,19 @@ var_element (gfc_data_variable * new)
sym = new->expr->symtree->n.sym;
- if(sym->value != NULL)
+ if (!sym->attr.function && gfc_current_ns->parent && gfc_current_ns->parent == sym->ns)
{
- gfc_error ("Variable '%s' at %C already has an initialization",
- sym->name);
+ gfc_error ("Host associated variable '%s' may not be in the DATA "
+ "statement at %C.", sym->name);
return MATCH_ERROR;
}
-#if 0 /* TODO: Find out where to move this message */
- if (sym->attr.in_common)
- /* See if sym is in the blank common block. */
- for (t = &sym->ns->blank_common; t; t = t->common_next)
- if (sym == t->head)
- {
- gfc_error ("DATA statement at %C may not initialize variable "
- "'%s' from blank COMMON", sym->name);
- return MATCH_ERROR;
- }
-#endif
+ if (gfc_current_state () != COMP_BLOCK_DATA
+ && sym->attr.in_common
+ && gfc_notify_std (GFC_STD_GNU, "Extension: initialization of "
+ "common block variable '%s' in DATA statement at %C",
+ sym->name) == FAILURE)
+ return MATCH_ERROR;
if (gfc_add_data (&sym->attr, sym->name, &new->expr->where) == FAILURE)
return MATCH_ERROR;
OpenPOWER on IntegriCloud