diff --git a/module.c b/module.c index f3b3caa..604acbb 100644 --- a/module.c +++ b/module.c @@ -4493,7 +4493,7 @@ check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info) module_locus locus; symbol_attribute attr; - if (st_sym->ns->proc_name && st_sym->name == st_sym->ns->proc_name->name) + if (st_sym->name == gfc_current_ns->proc_name->name) { gfc_error ("'%s' of module '%s', imported at %C, is also the name of the " "current program unit", st_sym->name, module_name);