On 1/11/26 12:33 PM, Steve Kargl wrote:
The attach patch fixes PR Fortran/91960.  This PR is another
one from Gerhard in 2019-10.01.  A patch has been lingering
in the PR since 2023-05-30.

The patch checks that an array constructor in a parameter
statement is in fact a constant expression.  I'll note
that the patch requires a special carve out to accommodate
the fix for Fortran/117070.

2026-01-11  Steven G. Kargl  <[email protected]>

        PR Fortran/91960
        * resolve.cc (resolve_fl_parameter):  Check the righthand symbol
        is a constant expression.

2026-01-11  Steven G. Kargl  <[email protected]>

        PR Fortran/91960
        * gfortran.dg/pr69962.f90: Adjust testcase to ignore new error message.
        * gfortran.dg/pr91960_1.f90: New test.
        * gfortran.dg/pr91960_2.f90: Ditto.


I am wondering about the comment:

+      /* PR fortran/117070 argues a nonconstant proc pointer can appear in
+        the array constructor of a paramater.  I don't buy it, but... */
+      if (sym->value->ts.type == BT_DERIVED
+         && sym->value->ts.u.derived
+         && sym->value->ts.u.derived->attr.proc_pointer_comp)
+       return true;
+      gfc_error ("Expecting constant expression near %L", &sym->value->where);
+      return false;

It either is allowed or it is not. Do we need to review the Standard to confirm or deny this?

Jerry

Reply via email to