diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-12-09 21:13:29 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-12-09 21:13:29 +0000 |
commit | 993ef28f827140e0df07c81ff2b03e14059b052d (patch) | |
tree | c8776eb41194bb8dda5bb0ceb9bff152156493b2 /gcc/fortran/symbol.c | |
parent | 1027275d2e6e9c34d1703406111ca2d7cab150dc (diff) | |
download | gcc-993ef28f827140e0df07c81ff2b03e14059b052d.zip gcc-993ef28f827140e0df07c81ff2b03e14059b052d.tar.gz gcc-993ef28f827140e0df07c81ff2b03e14059b052d.tar.bz2 |
re PR other/29975 ([meta-bugs] ICEs with CP2K)
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29975
PR fortran/30068
PR fortran/30096
* interface.c (compare_type_rank_if): Reject invalid generic
interfaces.
(check_interface1): Give a warning for nonreferred to ambiguous
interfaces.
(check_sym_interfaces): Check whether an ambiguous interface is
referred to. Do not check host associated interfaces since these
cannot be ambiguous with the local versions.
(check_uop_interface, gfc_check_interfaces): Update call to
check_interface1.
* symbol.c (gfc_get_sym_tree, gfc_get_sym_tree): Allow adding
unambiguous procedures to generic interfaces.
* gfortran.h (symbol_attribute): Added use_only and
ambiguous_interfaces.
* module.c (load_need): Set the use_only flag, if needed.
* resolve.c (resolve_fl_procedure): Warn for nonreferred
interfaces.
* expr.c (find_array_section): Fix initializer array contructor.
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/29975
PR fortran/30068
* gfortran.dg/interface_4.f90: Test adding procedure to generic
interface.
* gfortran.dg/interface_5.f90: Test warning for not-referenced-to
ambiguous interfaces.
* gfortran.dg/interface_6.f90: Test invalid, ambiguous interface.
* gfortran.dg/interface_7.f90: Test invalid, ambiguous interface.
* gfortran.dg/interface_8.f90: Test warning for not-referenced-to
ambiguous interfaces.
* gfortran.dg/interface_1.f90: Change dg-error into a dg-warning.
* gfortran.dg/array_initializer_2.f90: Add initializer array
constructor test.
PR fortran/30096
* gfortran.dg/interface_9.f90: Test that host interfaces are
not checked for ambiguity with the local version.
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r119697
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 7cb5e76..a809082 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2037,7 +2037,9 @@ gfc_find_sym_tree (const char *name, gfc_namespace * ns, int parent_flag, if (st != NULL) { *result = st; - if (st->ambiguous) + /* Ambiguous generic interfaces are permitted, as long + as the specific interfaces are different. */ + if (st->ambiguous && !st->n.sym->attr.generic) { ambiguous_symbol (name, st); return 1; @@ -2138,8 +2140,10 @@ gfc_get_sym_tree (const char *name, gfc_namespace * ns, gfc_symtree ** result) } else { - /* Make sure the existing symbol is OK. */ - if (st->ambiguous) + /* Make sure the existing symbol is OK. Ambiguous + generic interfaces are permitted, as long as the + specific interfaces are different. */ + if (st->ambiguous && !st->n.sym->attr.generic) { ambiguous_symbol (name, st); return 1; |