[Patch, Fortran] [RFC] PR fortran/36746 / missing part from PR 32095?

Tobias Burnus burnus@net-b.de
Thu Sep 4 20:25:00 GMT 2008


Hi Daniel,

Daniel Kraft wrote:
> On the other hand, however, code that gets now
> rejected is:
>
> IMPLICIT TYPE(t) (x)
> DIMENSION x(:)
> INTEGER :: x ! 'x' already has a type (TYPE(t))!
>
> Is code like that legal?

I believe so. All my compilers including NAG f95 compile it; and I
could not find anything in the standard, which disallows this.
I believe it also makes sense: For "dimension x(:)" the data type of "x"
does not matter.

That is different to PR 32095, which is about specification expressions;
here the data type is crutial. For completeness, for specification
expressions, 7.1.6.2 of F2003 contains the following, which clearly does not apply:

"If a specification expression includes a reference to an inquiry function for
a type parameter or an array bound of an entity specified in the same
specification-part, the type parameter or array bound shall be specified in a
prior specification of the specification-part. The prior specification may be
to the left of the inquiry function reference in the same statement. If a
specification expression includes a reference to the value of an element of an
array specified in the same specification-part, the array shall be completely
specified in prior declarations."

Thus: The patch is unfortunately not OK for the trunk.

Tobias



More information about the Fortran mailing list