diff options
author | Tobias Burnus <burnus@net-b.de> | 2007-08-30 15:44:47 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2007-08-30 15:44:47 +0200 |
commit | e9f63ace2335dc9bf97cf853408d4070c11218af (patch) | |
tree | d3b5361965e6f0cc0dc4972d868e9b3cee4b3d54 /gcc/fortran/interface.c | |
parent | 541d3103fc50b32bf5d5d4a403995e3857eb030e (diff) | |
download | gcc-e9f63ace2335dc9bf97cf853408d4070c11218af.zip gcc-e9f63ace2335dc9bf97cf853408d4070c11218af.tar.gz gcc-e9f63ace2335dc9bf97cf853408d4070c11218af.tar.bz2 |
re PR fortran/33228 (Accepts use-associated functions in MODULE PROCEDURE)
2007-08-30 Tobias Burnus <burnus@net-b.de>
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 <burnus@net-b.de>
PR fortran/33228
* gfortran.dg/generic_9.f90: Update error message.
* gfortran.dg/generic_14.f90: New.
From-SVN: r127925
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 17 |
1 files changed, 10 insertions, 7 deletions
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; } } |