aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-01-17 17:33:35 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-01-17 17:33:35 +0000
commit9dd8004e9108e08d45b25781bc6d44a624f690b8 (patch)
tree645ca4be34c9123444441514fc00fbc40f0f5d07 /gcc/fortran/module.c
parent8086b65daacc347fcbb79f4f3e4312b18a3accfe (diff)
downloadgcc-9dd8004e9108e08d45b25781bc6d44a624f690b8.zip
gcc-9dd8004e9108e08d45b25781bc6d44a624f690b8.tar.gz
gcc-9dd8004e9108e08d45b25781bc6d44a624f690b8.tar.bz2
re PR fortran/30476 ([Regression 4.2, 4.3] Via other module imported generic interface rejected)
2007-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/30476 * module.c (load_generic_interfaces): Make the marking of the symbol as ambiguous conditional on the module names being different. (write_generic): Ensure that the generic interface has a non-NULL module field. 2007-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/30476 * gfortran.dg/generic_12.f90: New test. From-SVN: r120860
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 05056a5..1613a74 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3097,9 +3097,11 @@ load_generic_interfaces (void)
gfc_symtree *st;
p = p ? p : name;
st = gfc_find_symtree (gfc_current_ns->sym_root, p);
- st->ambiguous = sym->attr.generic ? 0 : 1;
+ if (!sym->attr.generic
+ && sym->module != NULL
+ && strcmp(module, sym->module) != 0)
+ st->ambiguous = 1;
}
-
if (i == 1)
{
mio_interface_rest (&sym->generic);
@@ -3748,6 +3750,9 @@ write_generic (gfc_symbol * sym)
|| !gfc_check_access (sym->attr.access, sym->ns->default_access))
return;
+ if (sym->module == NULL)
+ sym->module = gfc_get_string (module_name);
+
mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
}