public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jerry DeLisle <jvdelisle@charter.net>
To: Tobias Burnus <tobias@codesourcery.com>, gfortran <fortran@gcc.gnu.org>
Subject: Re: [patch, fortran] PR96686 Namelist group objects shall be defined before appearing in namelist
Date: Fri, 19 Feb 2021 07:58:13 -0800	[thread overview]
Message-ID: <3811e3ad-8db4-f031-95e9-6ade0f63ef0d@charter.net> (raw)
In-Reply-To: <4ae5418a-a51d-23a4-12fe-81342bd6f7d2@codesourcery.com>

On 2/17/21 1:19 AM, Tobias Burnus wrote:
> Hi Jerry,
>
> I note that you have not written that testcase and I am still half
> aspleep, but I fail to see what's wrong with the following program
> (before and after your change):
>
> f2 looks like a local and implicitly typed real variable. At least ifort
> compiles this program successfully.
>
> F2018 has: "A namelist group object shall either be accessed by use or
> host association or shall have its declared type, kind type parameters
> of the declared type, and rank specified by previous specification
> statements or the procedure heading in the same scoping unit or by the
> implicit typing rules in effect for the scoping unit. If a namelist
> group object is typed by the implicit typing rules, its appearance in
> any subsequent type declaration statement shall confirm the implied type
> and type parameters."
>
> Tobias
>
---  snip ---

So the program in question, extracted from namelist_4.f90, showing the 
other possible use of f2.

    program p1

    contains
       integer function f1()
         !f2 = 1   !This gives an error trying to assign a vakue to a
    function.
         j = f2    ! This is OK
         f1 = 1
       end function
       integer function f2()
         f2=1
       end function
    end

As far as I understand, gfortran has this correct, unless there is 
something in the standard I don't know yet.

Jerry




  reply	other threads:[~2021-02-19 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  3:02 Jerry DeLisle
2021-02-17  9:19 ` Tobias Burnus
2021-02-19 15:58   ` Jerry DeLisle [this message]
2021-02-19 16:42 ` Tobias Burnus

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=3811e3ad-8db4-f031-95e9-6ade0f63ef0d@charter.net \
    --to=jvdelisle@charter.net \
    --cc=fortran@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /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).