This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30870] GENERIC non-INTRINSIC procedure rejected as actual argument
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2007 10:47:35 -0000
- Subject: [Bug fortran/30870] GENERIC non-INTRINSIC procedure rejected as actual argument
- References: <bug-30870-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pault at gcc dot gnu dot org 2007-02-21 10:47 -------
This fixes it:
Index: gcc/fortran/resolve.c
===================================================================
*** gcc/fortran/resolve.c (revision 122101)
--- gcc/fortran/resolve.c (working copy)
*************** resolve_actual_arglist (gfc_actual_argli
*** 924,932 ****
if (sym->attr.generic)
{
! 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
--- 924,943 ----
if (sym->attr.generic)
{
! 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
It needs commenting to the effect that a generic that is also a specific is OK.
I'd be more than happy if somebody would regtest/submit/commit this one - I
cannot for some weeks.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30870