summaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-30 13:44:47 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-30 13:44:47 +0000
commitd9e734f3d58db5cc650b1e3b095388aa019020c1 (patch)
treed3b5361965e6f0cc0dc4972d868e9b3cee4b3d54 /gcc/fortran/interface.c
parent011634f25a3eebed2a4a9a2041046a83695ff4f6 (diff)
downloadgcc-d9e734f3d58db5cc650b1e3b095388aa019020c1.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 55cc641cf88..7bb5a25834f 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;
}
}