public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: "Dominique d'Humières" <dominiq@lps.ens.fr>
Cc: Tobias Burnus <burnus@net-b.de>,
	fortran@gcc.gnu.org,        gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR47040 - Make error message for empty array constructor more helpful/correct
Date: Sat, 09 Apr 2016 15:39:00 -0000	[thread overview]
Message-ID: <20160409153907.GA47292@troutmask.apl.washington.edu> (raw)
In-Reply-To: <8E1D4A5A-F220-4A32-B0F2-EC8CC4BF327E@lps.ens.fr>

On Sat, Apr 09, 2016 at 12:28:12PM +0200, Dominique d'Humières wrote:
> >>> On Wed, Apr 06, 2016 at 05:44:55PM +0200, Dominique d'Humières wrote:
> >>>> Is the following patch OK (regtested on x86_64-apple-darwin15)? Should it be back ported to the gcc-5 branch?
> >>> 
> >>> No and No.
> > Le 7 avr. 2016 à 15:59, Steve Kargl <sgk@troutmask.apl.washington.edu> a écrit :
> > 
> > The latter is obvious as this "fixes" neither a regression
> > nor documentation.  
> 
> I won’t argue.
> 
> > For the former, see Fortran 95, section 4.5.
> > 
> > -- 
> > steve
> 
> 
> Are you referring to
> 
> (a)  An empty sequence forms a zero-sized rank-one array.
> 
> (b) The type and type parameters of an array constructor are those of the ac-value expressions.
> 
> (c) something else?
> 

Fortran 95 doesn't have a type-spec in an array constructor.
Fortran 95 explicitly states

  "The type and type parameters of an array constructor are
   those of the ac-value expressions."

(/ /) is valid Fortran 95 syntax while (/ type-spec :: /) is
not valid.  type-spec was introduced in Fortran 2003.  The
error message as written is correct.

(/ /) is empty.
(/type-spec :: /) is not empty, and is  invalid Fortan 95.
(/1, 2, 3/) is not empty and has a type of INTEGER.

program foo
   call bar((/ /))
end program foo

% gfc -c -std=f95 foo.f90
foo.f90:2:17:

    call bar((/ /))
                 1
Error: Empty array constructor at (1) is not allowed

The above error is correct.  Adding any text referring
to type-spec is wrong.
 
-- 
Steve

  reply	other threads:[~2016-04-09 15:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 15:45 Dominique d'Humières
2016-04-07  5:48 ` Steve Kargl
2016-04-07  5:51   ` Dominique d'Humières
2016-04-07 13:59     ` Steve Kargl
2016-04-09 10:28       ` Dominique d'Humières
2016-04-09 15:39         ` Steve Kargl [this message]
2016-04-09 15:58           ` Dominique d'Humières
2016-04-09 16:13             ` Steve Kargl
2016-04-09 16:51               ` Dominique d'Humières
2016-04-09 17:03                 ` Steve Kargl
2016-04-09 18:43                   ` [PATCH withdrawn] PR47040 - Make error message for empty array constructor more helpful/correct, closed as INVALID Dominique d'Humières

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=20160409153907.GA47292@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=burnus@net-b.de \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@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).