gfortran 12.2 accepts the code below if the "allocatable" attribute is
removed:

% cat gfortran-lock-issue.f90
  use iso_fortran_env
  type foo
    type(lock_type), allocatable :: bar
  end type
  type(foo) foobar[*]
end

 % gfortran -fcoarray=single gfortran-lock-issue.f90
gfortran-lock-issue.f90:3:39:
    3 |     type(lock_type), allocatable :: bar
      |                                       1
Error: Allocatable component bar at (1) of type LOCK_TYPE must have a
codimension

The NAG compiler accepts the above code with or without the allocatable
attribute, and I believe constraint C1608 in the Fortran 2018
interpretation document makes the above code valid.

Damian

Reply via email to