]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/25061 (procedure name conflict)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 21 Jun 2007 01:18:02 +0000 (01:18 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 21 Jun 2007 01:18:02 +0000 (01:18 +0000)
2007-06-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/25061
* decl.c (get_proc_name) Check symbol for generic interface
and issue an error.

From-SVN: r125906

gcc/fortran/ChangeLog
gcc/fortran/decl.c

index fbda11c53402458fc71bb058eed517d4e228dfb8..446d8b173cd2a0cc6fabf6423f50554ed3654a47 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/25061
+       * decl.c (get_proc_name) Check symbol for generic interface
+       and issue an error.
+
 2007-06-20  Andrew Pinski  <andrew_pinski@playstation.sony.com>
        Richard Guenther  <rguenther@suse.de>
 
index 82d3e6686ca96ee32ea9381bd6e0b245f307a471..2568a50c7b30ba1375d763c036234ba062d9f5f0 100644 (file)
@@ -696,6 +696,14 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
        gfc_error_now ("Procedure '%s' at %C is already defined at %L",
                       name, &sym->declared_at);
 
+      /* Trap a procedure with a name the same as interface in the
+        encompassing scope.  */
+      if (sym->attr.generic != 0
+         && (sym->attr.subroutine || sym->attr.function))
+       gfc_error_now ("Name '%s' at %C is already defined"
+                      " as a generic interface at %L",
+                      name, &sym->declared_at);
+
       /* Trap declarations of attributes in encompassing scope.  The
         signature for this is that ts.kind is set.  Legitimate
         references only set ts.type.  */