This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/60507] Passing function call into procedure argument not caught


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",


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]