Recursive derived type specifications - PR21458 - a standard question.

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Oct 1 18:07:00 GMT 2005


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



More information about the Fortran mailing list