public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* PR 107406
@ 2022-10-26  5:17 Damian Rouson
  0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2022-10-26  5:17 UTC (permalink / raw)
  To: fortran

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-26  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  5:17 PR 107406 Damian Rouson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).