NUMBER: F23/009
TITLE: Coarray subobject of component
KEYWORDS: coarray, allocatable, array, component
DEFECT TYPE: Erratum
STATUS: Passed by J3 meeting
QUESTION:
The Introduction of Fortran 2023 says
“A data object with a coarray component can be an array or
allocatable.”
This appears to be true for named variables, but there is a constraint
that makes it impossible for an array component or an allocatable
component:
“C753 A data component whose type has a coarray potential subobject
component shall be a nonpointer nonallocatable scalar and
shall not be a coarray.”
That means that given the type
Type real_coarray
Real,Allocatable :: c[:]
End Type
the statements
Type(real_coarray) x(100)
Type(real_coarray),Allocatable :: y
are acceptable as type declaration statements, but unacceptable as
component definition statements.
Is this irregularity deliberate?
ANSWER:
No, this constraint was accidentally overlooked when extending types
with coarray components to be subobjects of arrays and allocatables.
An edit is provided to correct this mistake.
EDIT to N2218 (Fortran 2023 FDIS):
[79:constraint C753] In subclause
Delete this constraint, which begins
“C753 A data component whose type has a coarray”
[80:After NOTE 1] Insert new NOTE
“NOTE 1.5
A data component whose type has a coarray potential subobject
component cannot be a coarray or a pointer, see constraint C825.”
{C825 says “An entity whose type has a coarray potential subobject…”
and components are certainly entities. We specifically wrote “entity”
instead of “named variable” to cover the component case.
I prefer to say it once and refer to it.}
SUBMITTED BY: John Reid & Reinhold Bader
HISTORY: 23-210 m231 Submitted
23-210r1 m231 Revised
23-210r2 m231 Passed as amended by J3 meeting 231.