diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index f6807d5..36e5eb9 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1846,11 +1846,24 @@ gfc_match_rvalue (gfc_expr ** result) gfc_set_sym_referenced (sym); - if (sym->attr.function && sym->result == sym - && (gfc_current_ns->proc_name == sym + if (sym->attr.function && sym->result == sym) + { + if (gfc_current_ns->proc_name == sym || (gfc_current_ns->parent != NULL - && gfc_current_ns->parent->proc_name == sym))) - goto variable; + && gfc_current_ns->parent->proc_name == sym)) + goto variable; + + if (sym->attr.entry + && (sym->ns == gfc_current_ns + || sym->ns == gfc_current_ns->parent)) + { + gfc_entry_list *el = NULL; + + for (el = sym->ns->entries; el; el = el->next) + if (sym == el->sym) + goto variable; + } + } if (sym->attr.function || sym->attr.external || sym->attr.intrinsic) goto function0; |