[Bug fortran/34657] program-unit MY_SUB imports symbol MY_SUB

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jul 17 11:55:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34657

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-17 11:54:40 UTC ---
Draft patch:

--- 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;



More information about the Gcc-bugs mailing list