From a7c0b11d97006d41facce468923d7ca80a853b6c Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sat, 4 Jul 2009 14:28:43 +0200 Subject: re PR fortran/40593 (Proc-pointer returning function as actual argument) 2009-07-04 Janus Weil PR fortran/40593 * interface.c (compare_actual_formal): Take care of proc-pointer-valued functions as actual arguments. * trans-expr.c (gfc_conv_procedure_call): Ditto. * resolve.c (resolve_specific_f0): Use the correct ts. 2009-07-04 Janus Weil PR fortran/40593 * gfortran.dg/proc_ptr_result_6.f90: New. From-SVN: r149227 --- gcc/fortran/interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/interface.c') diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index c03c06e..ca500f5 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1911,7 +1911,10 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, /* Satisfy 12.4.1.3 by ensuring that a procedure pointer actual argument is provided for a procedure pointer formal argument. */ if (f->sym->attr.proc_pointer - && !(a->expr->symtree->n.sym->attr.proc_pointer + && !((a->expr->expr_type == EXPR_VARIABLE + && a->expr->symtree->n.sym->attr.proc_pointer) + || (a->expr->expr_type == EXPR_FUNCTION + && a->expr->symtree->n.sym->result->attr.proc_pointer) || is_proc_ptr_comp (a->expr, NULL))) { if (where) -- cgit v1.1