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

--- Comment #3 from Ivan Pribec <ivan.pribec at gmail dot com> ---
According to my reading, the right hand side in the assignment matches the
following two cases of constant expressions, quoting 10.1.12:

2) an array constructor where each element ... is a constant expression

3) a structure constructor where each component-spec corresponding to

   (b) a pointer component is an initialization target

In flang they implement this, with the caveat, the initialization targets in
the structure constructor must have an explicit interface "visible" prior to
the statement containing the constant expression. Details here:
https://github.com/llvm/llvm-project/issues/72058

In general an internal procedure or module procedure has an explicit interface
within the scope of the procedure/module, which allows things like this:

program test
procedure(tp), pointer :: p
p => tp
print *, p()
contains
  function tp()
    real :: tp
    tp = 3.0
  end function
end program

What this means is that in-principle a, b, c could also be declared in the
module dispatch_table; the NAG compiler allows this.

I can ask on the Intel Community Forum.

Reply via email to