diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-03-15 06:44:25 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-03-15 06:44:25 +0000 |
commit | 36d3fb4cfe1c79915ed747b54f6a1aa2a471a833 (patch) | |
tree | 5cb4c73baa1e5f429a60e96974501d4c438fcd54 /gcc/fortran/resolve.c | |
parent | 23dd73839f0024c837c3304f46c2b90c4645e9a2 (diff) | |
download | gcc-36d3fb4cfe1c79915ed747b54f6a1aa2a471a833.zip gcc-36d3fb4cfe1c79915ed747b54f6a1aa2a471a833.tar.gz gcc-36d3fb4cfe1c79915ed747b54f6a1aa2a471a833.tar.bz2 |
[multiple changes]
2007-03-15 Tobias Burnus <burnus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/30922
* decl.c (gfc_match_import): If the parent of the current name-
space is null, try looking for an imported symbol in the parent
of the proc_name interface.
* resolve.c (resolve_fl_variable): Do not check for blocking of
host association by a same symbol, if the symbol is in an
interface body.
2007-03-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30879
* decl.c (match_data_constant): Before going on to try to match
a name, try to match a structure component.
PR fortran/30870
* resolve.c (resolve_actual_arglist): Do not reject a generic
actual argument if it has a same name specific interface.
PR fortran/31163
* trans-array.c (parse_interface): Do not nullify allocatable
components if the symbol has the saved attribute.
2007-03-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30922
* gfortran.dg/import5.f90.f90: New test.
PR fortran/30879
* gfortran.dg/data_components_1.f90: New test.
PR fortran/30870
* gfortran.dg/generic_13.f90: New test.
PR fortran/31163
* gfortran.dg/alloc_comp_basics_5.f90: New test.
From-SVN: r122944
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 987d73b..db55c0c 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -922,11 +922,24 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) &e->where); } + /* Check if a generic interface has a specific procedure + with the same name before emitting an error. */ if (sym->attr.generic) { - gfc_error ("GENERIC non-INTRINSIC procedure '%s' is not " - "allowed as an actual argument at %L", sym->name, - &e->where); + gfc_interface *p; + for (p = sym->generic; p; p = p->next) + if (strcmp (sym->name, p->sym->name) == 0) + { + e->symtree = gfc_find_symtree + (p->sym->ns->sym_root, sym->name); + sym = p->sym; + break; + } + + if (p == NULL || e->symtree == NULL) + gfc_error ("GENERIC non-INTRINSIC procedure '%s' is not " + "allowed as an actual argument at %L", sym->name, + &e->where); } /* If the symbol is the function that names the current (or @@ -5663,7 +5676,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag) /* Check to see if a derived type is blocked from being host associated by the presence of another class I symbol in the same namespace. 14.6.1.3 of the standard and the discussion on comp.lang.fortran. */ - if (sym->ts.type == BT_DERIVED && sym->ns != sym->ts.derived->ns) + if (sym->ts.type == BT_DERIVED && sym->ns != sym->ts.derived->ns + && sym->ns->proc_name->attr.if_source != IFSRC_IFBODY) { gfc_symbol *s; gfc_find_symbol (sym->ts.derived->name, sym->ns, 0, &s); |