diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a9a11c0..02dc38c 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -635,7 +635,8 @@ get_proc_name (const char *name, gfc_symbol ** result, accessible names. */ if (sym->attr.flavor != 0 && sym->attr.proc != 0 - && sym->formal) + && (sym->attr.subroutine || sym->attr.function) + && sym->attr.if_source != IFSRC_UNKNOWN) gfc_error_now ("Procedure '%s' at %C is already defined at %L", name, &sym->declared_at); @@ -643,6 +644,7 @@ get_proc_name (const char *name, gfc_symbol ** result, signature for this is that ts.kind is set. Legitimate references only set ts.type. */ if (sym->ts.kind != 0 + && !sym->attr.implicit_type && sym->attr.proc == 0 && gfc_current_ns->parent != NULL && sym->attr.access == 0 @@ -2679,7 +2681,9 @@ gfc_match_function_decl (void) || copy_prefix (&sym->attr, &sym->declared_at) == FAILURE) goto cleanup; - if (current_ts.type != BT_UNKNOWN && sym->ts.type != BT_UNKNOWN) + if (current_ts.type != BT_UNKNOWN + && sym->ts.type != BT_UNKNOWN + && !sym->attr.implicit_type) { gfc_error ("Function '%s' at %C already has a type of %s", name, gfc_basic_typename (sym->ts.type)); |