aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 611754c..6ffa4b2 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1011,6 +1011,7 @@ check_sym_interfaces (gfc_symbol * sym)
{
char interface_name[100];
bool k;
+ gfc_interface *p;
if (sym->ns != gfc_current_ns)
return;
@@ -1021,6 +1022,18 @@ check_sym_interfaces (gfc_symbol * sym)
if (check_interface0 (sym->generic, interface_name))
return;
+ 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)
+ {
+ gfc_error ("MODULE PROCEDURE '%s' at %L does not come "
+ "from a module", p->sym->name, &p->where);
+ return;
+ }
+ }
+
/* Originally, this test was aplied to host interfaces too;
this is incorrect since host associated symbols, from any
source, cannot be ambiguous with local symbols. */