aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-12-20 13:48:06 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-12-20 13:48:06 +0000
commit71f77fd790b55c7d6b831d76665bdf26a65fad2b (patch)
tree006a73693cd6f5f41909b3e2d5aff9801697221d /gcc/fortran/interface.c
parent0550e7b7aa95d5edd861932b4301a659266f0d0a (diff)
downloadgcc-71f77fd790b55c7d6b831d76665bdf26a65fad2b.zip
gcc-71f77fd790b55c7d6b831d76665bdf26a65fad2b.tar.gz
gcc-71f77fd790b55c7d6b831d76665bdf26a65fad2b.tar.bz2
re PR fortran/29992 ([4.1 only] INTERFACE equivalent to MODULE PROCEDURE?!)
2006-12-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/29992 * interface.c (check_sym_interfaces): Module procedures in a generic must be use associated or contained in the module. * decl.c (gfc_match_modproc): Set attribute mod_proc. * gfortran.h (symbol_attribute): Add mod_proc atribute. PR fortran/30081 * resolve.c (resolve_generic_f, resolve_generic_s): Use gfc_intrinsic_name to find out if the function is intrinsic because it does not have to be a generic intrinsic to be overloaded. 2006-12-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/29992 * gfortran.dg/generic_9.f90: New test. PR fortran/30081 * gfortran.dg/generic_10.f90: New test. From-SVN: r120072
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. */