public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35299] scope of variables in statement function do not acquire rank from host
Date: Fri, 29 Feb 2008 20:42:00 -0000	[thread overview]
Message-ID: <20080229204147.19233.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35299-10110@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2008-02-29 20:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 23:31 [Bug fortran/35299] New: " kargl at gcc dot gnu dot org
2008-02-22 23:33 ` [Bug fortran/35299] " kargl at gcc dot gnu dot org
2008-02-23 20:23 ` tkoenig at gcc dot gnu dot org
2008-02-29 17:54 ` fxcoudert at gcc dot gnu dot org
2008-02-29 20:15 ` sgk at troutmask dot apl dot washington dot edu
2008-02-29 20:24 ` fxcoudert at gcc dot gnu dot org
2008-02-29 20:42 ` sgk at troutmask dot apl dot washington dot edu [this message]
2008-02-29 22:56 ` fxcoudert at gcc dot gnu dot org
2008-02-29 23:06 ` sgk at troutmask dot apl dot washington dot edu
2008-02-29 23:53 ` sgk at troutmask dot apl dot washington dot edu
2008-08-08 21:07 ` jv244 at cam dot ac dot uk
2008-08-08 23:48 ` sgk at troutmask dot apl dot washington dot edu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080229204147.19233.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).