summaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-27 21:29:19 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-27 21:29:19 +0000
commit8e5ab24606cb98192bd52eff95654694fe6038be (patch)
tree22ef55bff748e9924fba15d6b5baabb76acb616d /gcc/fortran/check.c
parent72e5da43b8cab03e0fbc8ded0b0ceab3ce11d653 (diff)
downloadgcc-8e5ab24606cb98192bd52eff95654694fe6038be.tar.gz
2011-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 * check.c (gfc_check_associated, gfc_check_null): Add coindexed * check. * match.c (gfc_match_nullify): Ditto. * resolve.c (resolve_deallocate_expr): Ditto. * trans-types.c (gfc_get_nodesc_array_type): Don't set * restricted for nonpointers. 2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_22.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174364 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 01651cb5a23..70c23e663e1 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -875,6 +875,15 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
return FAILURE;
}
+ /* F2008, C1242. */
+ if (attr1.pointer && gfc_is_coindexed (pointer))
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
+ "conindexed", gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic, &pointer->where);
+ return FAILURE;
+ }
+
/* Target argument is optional. */
if (target == NULL)
return SUCCESS;
@@ -902,6 +911,15 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
return FAILURE;
}
+ /* F2008, C1242. */
+ if (attr1.pointer && gfc_is_coindexed (target))
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
+ "conindexed", gfc_current_intrinsic_arg[1]->name,
+ gfc_current_intrinsic, &target->where);
+ return FAILURE;
+ }
+
t = SUCCESS;
if (same_type_check (pointer, 0, target, 1) == FAILURE)
t = FAILURE;
@@ -2651,6 +2669,15 @@ gfc_check_null (gfc_expr *mold)
return FAILURE;
}
+ /* F2008, C1242. */
+ if (gfc_is_coindexed (mold))
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
+ "conindexed", gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic, &mold->where);
+ return FAILURE;
+ }
+
return SUCCESS;
}