summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-03 20:13:03 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-03 20:13:03 +0000
commitd45fced70592901ab2f7b160705af400c42759b0 (patch)
treeff6592e326477dbf0ff17a5d2950e64c46cbeade /gcc/fortran/resolve.c
parentdca06990e6e0072e208e73b5f1e89567e768433b (diff)
downloadppe42-gcc-d45fced70592901ab2f7b160705af400c42759b0.tar.gz
ppe42-gcc-d45fced70592901ab2f7b160705af400c42759b0.zip
2006-10-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29284 PR fortran/29321 PR fortran/29322 * trans-expr.c (gfc_conv_function_call): Check the expression and the formal symbol are present when testing the actual argument. PR fortran/25091 PR fortran/25092 * resolve.c (resolve_entries): It is an error if the entries of an array-valued function do not have the same shape. 2006-10-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/29284 * gfortran.dg/optional_assumed_charlen_1.f90: New test. PR fortran/29321 PR fortran/29322 * gfortran.dg/missing_optional_dummy_2.f90: New test. PR fortran/25091 PR fortran/25092 * gfortran.dg/entry_array_specs_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117413 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index c9af0c01b74..854d3b43845 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -419,23 +419,33 @@ resolve_entries (gfc_namespace * ns)
{
gfc_symbol *sym;
gfc_typespec *ts, *fts;
-
+ gfc_array_spec *as, *fas;
gfc_add_function (&proc->attr, proc->name, NULL);
proc->result = proc;
+ fas = ns->entries->sym->as;
+ fas = fas ? fas : ns->entries->sym->result->as;
fts = &ns->entries->sym->result->ts;
if (fts->type == BT_UNKNOWN)
fts = gfc_get_default_type (ns->entries->sym->result, NULL);
for (el = ns->entries->next; el; el = el->next)
{
ts = &el->sym->result->ts;
+ as = el->sym->as;
+ as = as ? as : el->sym->result->as;
if (ts->type == BT_UNKNOWN)
ts = gfc_get_default_type (el->sym->result, NULL);
+
if (! gfc_compare_types (ts, fts)
|| (el->sym->result->attr.dimension
!= ns->entries->sym->result->attr.dimension)
|| (el->sym->result->attr.pointer
!= ns->entries->sym->result->attr.pointer))
break;
+
+ else if (as && fas && gfc_compare_array_spec (as, fas) == 0)
+ gfc_error ("Procedure %s at %L has entries with mismatched "
+ "array specifications", ns->entries->sym->name,
+ &ns->entries->sym->declared_at);
}
if (el == NULL)
OpenPOWER on IntegriCloud