From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19860 invoked by alias); 29 Feb 2008 20:42:30 -0000 Received: (qmail 19234 invoked by alias); 29 Feb 2008 20:41:47 -0000 Date: Fri, 29 Feb 2008 20:42:00 -0000 Message-ID: <20080229204147.19233.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/35299] scope of variables in statement function do not acquire rank from host In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sgk at troutmask dot apl dot washington dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg03006.txt.bz2 ------- 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