diff options
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 4afe467..b62ad8d 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4278,6 +4278,13 @@ 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) + { + gfc_error ("'%s' of module '%s', imported at %C, is also the name of the " + "current program unit", st_sym->name, module_name); + return true; + } + rsym = info->u.rsym.sym; if (st_sym == rsym) return false; |