public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/47915] New: Type declaration: Recursive specification expression not detected.
Date: Sun, 27 Feb 2011 17:12:00 -0000	[thread overview]
Message-ID: <bug-47915-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: Type declaration: Recursive specification expression
                    not detected.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Based on
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/8c8effead3390ad2

The following is invalid as the LEN= specification expression is circular and
-- with the "+1" in LEN not possible.

(I think without "+1" it might work as the implicit typing has len=1, which is
then used to type "a" which can then used for "b" and which then matches the
initial value of 1. It is probably still invalid, but at least not
contradictory.)

>From the standard:

"A variable in a specification expression shall have its type and type
parameters, if any, specified by a previous declaration in the same
scoping unit, by the implicit typing rules in effect for the scoping
unit, or by host or use association. If a variable in a specification
expression is typed by the implicit typing rules, its appearance in any
subsequent type declaration statement shall confirm the implied type and
type parameters." (F2008, 7.1.11 Specification expression)

Test case - only g95 complains:

Error: Circular specification in variable 'a' at (1)

gfortran accepts it even with -std=f95

  subroutine foo(a, b)
    implicit character (A-Z)
    character(len=len(b)+1) :: a
    character(len=len(a)+1) :: b 
  end


             reply	other threads:[~2011-02-27 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 17:12 burnus at gcc dot gnu.org [this message]
2013-06-15 11:22 ` [Bug fortran/47915] " dominiq at lps dot ens.fr

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=bug-47915-4@http.gcc.gnu.org/bugzilla/ \
    --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).