public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: sgk@troutmask.apl.washington.edu,
	Harald Anlauf via Fortran <fortran@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]
Date: Tue, 4 Jul 2023 11:26:26 +0200	[thread overview]
Message-ID: <503c61f1-1ce3-3e04-a890-ec652d74a693@orange.fr> (raw)
In-Reply-To: <ZKNgE97UNTdHnaLm@troutmask.apl.washington.edu>

Le 04/07/2023 à 01:56, Steve Kargl a écrit :
> On Mon, Jul 03, 2023 at 10:49:36PM +0200, Harald Anlauf via Fortran wrote:
>>
>> Indeed, this is a nice demonstration.
>>
>> While playing, I was wondering whether the following code is conforming:
>>
>> program p
>>    call s ((1))
>> contains
>>    subroutine s (x)
>>      integer :: x
>>      x = 42
>>    end subroutine
>> end
>>
>> (It crashes with gfortran, but not with any foreign brand tested).
>>
> 
> It's not conforming.  '(1)' is an expression and it cannot appear
> in a variable definition condition.  I am not aware of any numbered
> constraint tha would require a Fortran processor to generate an
> error.
> 

I think you would be right if X had INTENT(OUT) or INTENT(INOUT) attribute.
This is F2023, 15.5.2.4 (no mention of variable definition context here):
> If a dummy argument has INTENT (OUT) or INTENT (INOUT), the actual argument shall be definable. 

However, with unspecified intent, I can't find the rule explicitly 
forbidding the above example.
I'm tempted to say it is conforming.

  reply	other threads:[~2023-07-04  9:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 20:38 Harald Anlauf
2023-07-03 11:46 ` Mikael Morin
2023-07-03 20:49   ` Harald Anlauf
2023-07-03 23:56     ` Steve Kargl
2023-07-04  9:26       ` Mikael Morin [this message]
2023-07-04 15:50         ` Steve Kargl
2023-07-04 13:35     ` Mikael Morin
2023-07-04 19:00       ` Harald Anlauf
2023-07-04 19:37         ` Mikael Morin
2023-07-05 14:54           ` Mikael Morin
2023-07-05 20:36             ` Harald Anlauf
2023-07-07 12:21               ` Mikael Morin
2023-07-07 18:23                 ` Harald Anlauf
2023-07-08 12:07                   ` Mikael Morin
2023-07-08 14:20                     ` Harald Anlauf

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=503c61f1-1ce3-3e04-a890-ec652d74a693@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).