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

--- Comment #6 from anlauf at gcc dot gnu.org ---
This change allows the reduced test from comment#5 to compile:

diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc
index 8f0004992e8..32624d8439e 100644
--- a/gcc/fortran/array.cc
+++ b/gcc/fortran/array.cc
@@ -1644,6 +1644,12 @@ check_constructor (gfc_constructor_base ctor, bool
(*check_function) (gfc_expr *
       if (!e)
        continue;

+      /* Allow procedures which can be the target of a procedure pointer.  */
+      if (e->expr_type == EXPR_VARIABLE
+         && e->ts.type == BT_PROCEDURE
+         && e->symtree->n.sym->attr.flavor == FL_PROCEDURE)
+       continue;
+
       if (e->expr_type != EXPR_ARRAY)
        {
          if (!(*check_function)(e))

This also accepts major parts of the original testcase from comment#0,
but mishandles the part using the static dispatch table.

FTR: this change regtests OK.

Reply via email to