This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Recursive derived type specifications - PR21458 - a standardquestion.
Paul Thomas wrote:
> Thanks. All the commercial compilers reject this as invalid code,
> whereas gfortran and g95 are happy with it.
>
> I have scoured the standard and cannot find any mention of the need for
> ordering of the derived type specifications. I am going to submit my
> recursion detector, together with the patch for PR24092.
The third and forth constraints on p. 32 restrict the order:
---
If the POINTER attribute is not specified for a component, a type-spec in the
component-def-stmt shall specify an intrinsic type or a previously defined
derived type.
If the POINTER attribute is specified for a component, a type-spec in the
component-def-stmt shall specify an intrinsic type or any accessible derived
type including the type being defined.
---
You gave two different examples, both of which are invalid by the first of
these constraints.
- Tobi