diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-12-27 13:46:47 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-12-27 13:46:47 +0000 |
commit | 9914f8cff9e43cc127de8e49d5d9751c6c3eedb8 (patch) | |
tree | 231b280ad1ab1a5c7cd73bfdbf36922437ed84e8 /gcc/fortran/interface.c | |
parent | 223da52186b67c474717dd7f221dd53515af64f4 (diff) | |
download | gcc-9914f8cff9e43cc127de8e49d5d9751c6c3eedb8.zip gcc-9914f8cff9e43cc127de8e49d5d9751c6c3eedb8.tar.gz gcc-9914f8cff9e43cc127de8e49d5d9751c6c3eedb8.tar.bz2 |
re PR fortran/20896 (ambiguous interface not detected)
2006-12-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20896
* interface.c (check_sym_interfaces): Try to resolve interface
reference as a global symbol, if it is not a nodule procedure.
(compare_actual_formal): Remove call to gfc_find_symbol; if
the expression is already a variable it is locally declared
and this has precedence.
gfortran.h : Add prototype for resolve_global_procedure.
resolve.c (resolve_global_procedure): Remove static attribute
from function declaration.
(resolve_fl_procedure): Remove symtree declaration and the
redundant check for an ambiguous procedure.
PR fortran/25135
* module.c (load_generic_interfaces): If the symbol is present
and is not generic it is ambiguous.
2006-12-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20896
* gfortran.dg/interface_10.f90: New test.
* gfortran.dg/dummy_procedure_1.f90: Add error for call s1(z),
since z is already, locally a variable.
PR fortran/25135
* gfortran.dg/generic_11.f90: New test.
* gfortran.dg/interface_7.f90: Remove name clash between module
name and procedure 'x' referenced in the interface.
From-SVN: r120218
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 1a5485e..8ec0b92 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1016,6 +1016,11 @@ check_sym_interfaces (gfc_symbol * sym) if (sym->ns != gfc_current_ns) return; + if (sym->attr.if_source == IFSRC_IFBODY + && sym->attr.flavor == FL_PROCEDURE + && !sym->attr.mod_proc) + resolve_global_procedure (sym, &sym->declared_at, sym->attr.subroutine); + if (sym->generic != NULL) { sprintf (interface_name, "generic interface '%s'", sym->name); @@ -1371,16 +1376,10 @@ compare_actual_formal (gfc_actual_arglist ** ap, && a->expr->expr_type == EXPR_VARIABLE && f->sym->attr.flavor == FL_PROCEDURE) { - gsym = gfc_find_gsymbol (gfc_gsym_root, - a->expr->symtree->n.sym->name); - if (gsym == NULL || (gsym->type != GSYM_FUNCTION - && gsym->type != GSYM_SUBROUTINE)) - { - if (where) - gfc_error ("Expected a procedure for argument '%s' at %L", - f->sym->name, &a->expr->where); - return 0; - } + if (where) + gfc_error ("Expected a procedure for argument '%s' at %L", + f->sym->name, &a->expr->where); + return 0; } if (f->sym->attr.flavor == FL_PROCEDURE |