This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]