diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index fbda11c5340..446d8b173cd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-06-20 Jerry DeLisle + + PR fortran/25061 + * decl.c (get_proc_name) Check symbol for generic interface + and issue an error. + 2007-06-20 Andrew Pinski Richard Guenther diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 82d3e6686ca..2568a50c7b3 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -696,6 +696,14 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry) gfc_error_now ("Procedure '%s' at %C is already defined at %L", name, &sym->declared_at); + /* Trap a procedure with a name the same as interface in the + encompassing scope. */ + if (sym->attr.generic != 0 + && (sym->attr.subroutine || sym->attr.function)) + gfc_error_now ("Name '%s' at %C is already defined" + " as a generic interface at %L", + name, &sym->declared_at); + /* Trap declarations of attributes in encompassing scope. The signature for this is that ts.kind is set. Legitimate references only set ts.type. */