diff options
Diffstat (limited to 'gcc/fortran/resolve.c')
| -rw-r--r-- | gcc/fortran/resolve.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 9b091ad0162..880dfd0e886 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1239,7 +1239,14 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, if (gfc_is_proc_ptr_comp (e, &comp)) { e->ts = comp->ts; - e->expr_type = EXPR_VARIABLE; + if (e->value.compcall.actual == NULL) + e->expr_type = EXPR_VARIABLE; + else + { + if (comp->as != NULL) + e->rank = comp->as->rank; + e->expr_type = EXPR_FUNCTION; + } goto argument_list; } @@ -8993,6 +9000,9 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor) } +static void resolve_symbol (gfc_symbol *sym); + + /* Resolve the components of a derived type. */ static gfc_try @@ -9031,6 +9041,9 @@ resolve_fl_derived (gfc_symbol *sym) { gfc_symbol *ifc = c->ts.interface; + if (ifc->formal && !ifc->formal_ns) + resolve_symbol (ifc); + if (ifc->attr.intrinsic) resolve_intrinsic (ifc, &ifc->declared_at); @@ -9832,6 +9845,20 @@ resolve_symbol (gfc_symbol *sym) if (sym->formal_ns && sym->formal_ns != gfc_current_ns) gfc_resolve (sym->formal_ns); + /* Make sure the formal namespace is present. */ + if (sym->formal && !sym->formal_ns) + { + gfc_formal_arglist *formal = sym->formal; + while (formal && !formal->sym) + formal = formal->next; + + if (formal) + { + sym->formal_ns = formal->sym->ns; + sym->formal_ns->refs++; + } + } + /* Check threadprivate restrictions. */ if (sym->attr.threadprivate && !sym->attr.save && !sym->ns->save_all && (!sym->attr.in_common |

