------- Comment #5 from sgk at troutmask dot apl dot washington dot edu 2008-02-29 20:41 ------- Subject: Re: scope of variables in statement function do not acquire rank from host
On Fri, Feb 29, 2008 at 08:23:16PM -0000, fxcoudert at gcc dot gnu dot org wrote: > (In reply to comment #3) > > The dummy arguments have a scope of the statement function. Each > > dummy argument has the same type and type parameters as the > > entity of the same name in the scoping unit containing the statement > > function. > > > > Note, this passage does not include rank. > > No, but it does not say that they are scalar either. It does not say "Each > dummy argument is a scalar of the same type and type parameters...". > > If we follow this interpretation, then what does "The function-name > and each dummy-arg-name shall be specified, explicitly or implicitly, > to be scalar" mean? In your (and Richard Maine's and ...) reading, > the dummy arguments are by definition scalar, and so how can they be > "specified, explicitly or implicitly, > to be scalar". Or, to say it the other way around, let's say that I want to > break this particular constraint, how do I explicitly specify one of my dummy > arguments not to be a scalar? > > I'm thoroughly confused. > Don't worry, I share your confusion (when I read the standard). :) I think the passage you quote applies to the following code: program z real :: y = 2. real :: x(5) = 1. f(x(2:4)) = 2 * sum(x) ! dummy arg is an array. g(y) = y * x ! function g is an array because of x. end program z I just found the definition of type parameters in 2.4.1.1. "The type parameters are KIND and LEN." All other attributes are irrelevant. PS: I see you just found the c.l.f threads. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35299