https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118845

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This works:

diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index fdde84db80d..eee5520ad93 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -5822,7 +5822,14 @@ gfc_get_formal_from_actual_arglist (gfc_symbol *sym,
          gfc_get_symbol (name, gfc_current_ns, &s);
          if (a->expr->ts.type == BT_PROCEDURE)
            {
+             gfc_symbol *asym = a->expr->symtree->n.sym;
              s->attr.flavor = FL_PROCEDURE;
+             if (asym->attr.function)
+               {
+                 s->attr.function = 1;
+                 s->ts = asym->ts;
+               }
+             s->attr.subroutine = asym->attr.subroutine;
            }
          else
            {

but causes some interesting fallout in the testsuite because this also
enables additional tests.  This will require a few more adjustments.

Reply via email to