This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/60507] Passing function call into procedure argument not caught
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Mar 2014 16:46:06 +0000
- Subject: [Bug fortran/60507] Passing function call into procedure argument not caught
- Auto-submitted: auto-generated
- References: <bug-60507-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60507
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
Summary|Passing real expression |Passing function call into
|into procedure argument not |procedure argument not
|caught |caught
--- Comment #2 from janus at gcc dot gnu.org ---
This helps (not regtested yet):
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 208455)
+++ gcc/fortran/interface.c (working copy)
@@ -2741,7 +2741,12 @@ compare_actual_formal (gfc_actual_arglist **ap, gf
/* Satisfy F03:12.4.1.3 by ensuring that a procedure actual argument is
provided for a procedure formal argument. */
if (f->sym->attr.flavor == FL_PROCEDURE
- && gfc_expr_attr (a->expr).flavor != FL_PROCEDURE)
+ && !((a->expr->expr_type == EXPR_VARIABLE
+ && (a->expr->symtree->n.sym->attr.flavor == FL_PROCEDURE
+ || a->expr->symtree->n.sym->attr.proc_pointer))
+ || (a->expr->expr_type == EXPR_FUNCTION
+ && a->expr->symtree->n.sym->result->attr.proc_pointer)
+ || gfc_is_proc_ptr_comp (a->expr)))
{
if (where)
gfc_error ("Expected a procedure for argument '%s' at %L",