public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "domob at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug 45776] (fortran) New: Full implementation of variable definition contexts (and related checks)
Date: Fri, 24 Sep 2010 08:06:00 -0000	[thread overview]
Message-ID: <bug-45776-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: Full implementation of variable definition contexts
                    (and related checks)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: domob@gcc.gnu.org


Since http://gcc.gnu.org/ml/fortran/2010-09/msg00397.html, there is a new
routine to check definability of variables and pointers in one place
(expr.c:gfc_check_vardef_context).  This should be called from all places
mentioned in the standard as variable definition context (F2008, 16.6.7) and
pointer association context (F2008, 16.6.8).

The pointer association contexts should already be implemented, but not all
variable definition contexts.  Missing are the IO related ones (items 5-10 of
the list in 16.6.7) and the ones related to co-array locks (items 14 and 15). 
These should also be implemented.

For instance, the following invalid program is accepted:

module m
  implicit none

  integer, protected :: a
  character(len=128), protected :: str

end module m

program main
  use :: m
  integer, parameter :: b = 42
  character(len=128) :: myStr

  myStr = '5'

  read(myStr, *) a
  read(myStr, *) b

  write(str, *) 5
end program main

Note that the last line (write to internal PROTECTED variable) was also
accepted before the definability check rework.

-- 
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


             reply	other threads:[~2010-09-24  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24  8:06 domob at gcc dot gnu.org [this message]
2010-09-24  8:10 ` [Bug 45776] (fortran) " domob at gcc dot gnu.org
2010-09-25 16:40 ` [Bug fortran/45776] " domob at gcc dot gnu.org
2010-09-25 16:49 ` domob at gcc dot gnu.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=bug-45776-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).