aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-06-21 01:18:02 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-06-21 01:18:02 +0000
commitfd3e70afce77d011d4889d84075bb3af388a4049 (patch)
tree07e0dcc099349be34d0f16f10b3cbe122c6148cc
parent5b418a87cf619dfe3277a3f87b55a95153493c37 (diff)
downloadgcc-fd3e70afce77d011d4889d84075bb3af388a4049.zip
gcc-fd3e70afce77d011d4889d84075bb3af388a4049.tar.gz
gcc-fd3e70afce77d011d4889d84075bb3af388a4049.tar.bz2
re PR fortran/25061 (procedure name conflict)
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
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fbda11c..446d8b1 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -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>
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 82d3e66..2568a50 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -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. */