From e9f63ace2335dc9bf97cf853408d4070c11218af Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 30 Aug 2007 15:44:47 +0200 Subject: re PR fortran/33228 (Accepts use-associated functions in MODULE PROCEDURE) 2007-08-30 Tobias Burnus PR fortran/33228 * interface.c (check_interface0): Improve error for external procs. (check_sym_interfaces): Fix checking of module procedures. 2007-08-30 Tobias Burnus PR fortran/33228 * gfortran.dg/generic_9.f90: Update error message. * gfortran.dg/generic_14.f90: New. From-SVN: r127925 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/interface.c | 17 ++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f87dc8f..e40c9e2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-08-30 Tobias Burnus + + PR fortran/33228 + * interface.c (check_interface0): Improve error for external procs. + (check_sym_interfaces): Fix checking of module procedures. + 2007-08-29 Francois-Xavier Coudert PR fortran/32989 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 55cc641..7bb5a25 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -988,9 +988,13 @@ check_interface0 (gfc_interface *p, const char *interface_name) for (; p; p = p->next) if (!p->sym->attr.function && !p->sym->attr.subroutine) { - gfc_error ("Procedure '%s' in %s at %L is neither function nor " - "subroutine", p->sym->name, interface_name, - &p->sym->declared_at); + if (p->sym->attr.external) + gfc_error ("Procedure '%s' in %s at %L has no explicit interface", + p->sym->name, interface_name, &p->sym->declared_at); + else + gfc_error ("Procedure '%s' in %s at %L is neither function nor " + "subroutine", p->sym->name, interface_name, + &p->sym->declared_at); return 1; } p = psave; @@ -1081,11 +1085,10 @@ check_sym_interfaces (gfc_symbol *sym) for (p = sym->generic; p; p = p->next) { - if (!p->sym->attr.use_assoc && p->sym->attr.mod_proc - && p->sym->attr.if_source != IFSRC_DECL) + if (p->sym->attr.mod_proc && p->sym->attr.if_source != IFSRC_DECL) { - gfc_error ("MODULE PROCEDURE '%s' at %L does not come " - "from a module", p->sym->name, &p->where); + gfc_error ("'%s' at %L is not a module procedure", + p->sym->name, &p->where); return; } } -- cgit v1.1