public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/30876] Array valued recursive function rejected
Date: Thu, 22 Mar 2007 07:41:00 -0000	[thread overview]
Message-ID: <20070322074117.23689.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30876-6642@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from burnus at gcc dot gnu dot org  2007-03-22 07:41 -------
(In reply to comment #5)
> Then, the following should be invalid and rejected, shouldn't it?
> recursive function f(i)
>   integer :: f, i
>   f = 0
>   if (i > 0) f = f(i-1) + 1
> end function

NAG f95:
  line 4: Recursive invocation of F which has no RESULT clause
(gfortran and ifort allow this)

> recursive function f(i) result(g)
>   integer :: g, i
>   g = 0
>   if (i > 0) g = g(i-1) + 1
> end function

NAG f95: Inconsistent usage of G
ifort: This name has not been declared as an array or a function
gfortran: Cannot assign to a named constant


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30876


  parent reply	other threads:[~2007-03-22  7:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20  7:52 [Bug fortran/30876] New: incorrect error message for valid code jv244 at cam dot ac dot uk
2007-02-20 16:28 ` [Bug fortran/30876] Array valued recursive function rejected burnus at gcc dot gnu dot org
2007-02-21 16:33 ` pault at gcc dot gnu dot org
2007-02-21 17:03 ` burnus at gcc dot gnu dot org
2007-02-21 18:52 ` pault at gcc dot gnu dot org
2007-03-22  0:22 ` fxcoudert at gcc dot gnu dot org
2007-03-22  7:41 ` burnus at gcc dot gnu dot org [this message]
2007-05-08 12:51 ` pault at gcc dot gnu dot org
2007-05-08 12:52 ` pault at gcc dot gnu dot org
2007-05-08 12:53 ` pault at gcc dot gnu dot org
2007-05-10  7:14 ` patchapp at dberlin dot org
2007-05-11 11:47 ` pault at gcc dot gnu dot org
2007-05-11 11:47 ` pault at gcc dot gnu dot org

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=20070322074117.23689.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).