aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-07-13 05:07:35 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-07-13 05:07:35 +0000
commit72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b (patch)
tree677273f32ea31a251f8e44292ca967e69e8d4e7b /gcc/fortran/check.c
parent3fb8727b3b054dbb2c934baf33bb8946eeb3fae1 (diff)
downloadgcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.zip
gcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.tar.gz
gcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.tar.bz2
re PR fortran/28174 (Corruption of multiple character arrays when passing array sections)
2006-07-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 * trans-expr.c (gfc_conv_aliased_arg): Missing formal arg means that intent is INOUT (fixes regression). PR fortran/25097 * check.c (check_present): The only permitted reference is a full array reference. PR fortran/20903 * decl.c (variable_decl): Add error if a derived type is not from the current namespace if the namespace is an interface body. 2006-07-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/25097 * gfortran.dg/present_1.f90: New test. PR fortran/20903 * gfortran.dg/interface_derived_type_1.f90: New test. From-SVN: r115410
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 5f536f5..1332c2b 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1867,6 +1867,22 @@ gfc_check_present (gfc_expr * a)
return FAILURE;
}
+/* 13.14.82 PRESENT(A)
+......
+ Argument. A shall be the name of an optional dummy argument that is accessible
+ in the subprogram in which the PRESENT function reference appears... */
+
+ if (a->ref != NULL
+ && !(a->ref->next == NULL
+ && a->ref->type == REF_ARRAY
+ && a->ref->u.ar.type == AR_FULL))
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must not be a sub-"
+ "object of '%s'", gfc_current_intrinsic_arg[0],
+ gfc_current_intrinsic, &a->where, sym->name);
+ return FAILURE;
+ }
+
return SUCCESS;
}