public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/49112] [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
Date: Sat, 28 May 2011 10:31:00 -0000	[thread overview]
Message-ID: <bug-49112-4-r7dkwUxfnd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49112-4@http.gcc.gnu.org/bugzilla/>

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Missing type-bound          |[4.6/4.7 Regression] [OOP]
                   |procedure, "duplicate save" |Missing type-bound
                   |warnings and internal       |procedure, "duplicate save"
                   |compiler error              |warnings and internal
                   |                            |compiler error

--- Comment #5 from janus at gcc dot gnu.org 2011-05-28 10:03:36 UTC ---
(In reply to comment #4)
> SAVE can be either a statement or an attribute.  When it's statement, it
> affects all the variables within the containing unit

Yes, of course. I completely forgot about this possibility.

Btw, the code in comment #3 works with gfortran 4.5, so it is in fact a
regression.


> The standard also allows the confirmation, as an attribute, of the SAVE at the
> module level, so, for a "triple save" example:
> 
> module t1_mod
>     save
> 
>     type :: t1
>         integer :: dummy = 0
>     end type
> 
>     type(t1), save :: a = t1(2), b = t1(3)
> end type
> 
> 
> Which also triggers a duplicate save warning.

This is at best a "double save", and I think the (F08) standard forbids it:

C580 (R553) If a SAVE statement with an omitted saved entity list appears in a
scoping unit, no other appearance of the SAVE attr-spec or SAVE statement is
permitted in that scoping unit.

So I think in this case gfortran correctly complains about a "Duplicate SAVE
attribute".


  parent reply	other threads:[~2011-05-28 10:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 16:28 [Bug fortran/49112] New: " jwmwalrus at gmail dot com
2011-05-22 16:31 ` [Bug fortran/49112] " jwmwalrus at gmail dot com
2011-05-22 16:35 ` jwmwalrus at gmail dot com
2011-05-22 17:41 ` janus at gcc dot gnu.org
2011-05-22 18:19 ` jwmwalrus at gmail dot com
2011-05-28 10:31 ` janus at gcc dot gnu.org [this message]
2011-05-28 10:52 ` [Bug fortran/49112] [4.6/4.7 Regression] [OOP] " janus at gcc dot gnu.org
2011-05-28 11:09 ` janus at gcc dot gnu.org
2011-05-28 16:31 ` jwmwalrus at gmail dot com
2011-05-30 20:01 ` janus at gcc dot gnu.org
2011-05-30 20:11 ` janus at gcc dot gnu.org
2011-06-12 12:40 ` rguenth at gcc dot gnu.org
2011-06-20 19:56 ` janus at gcc dot gnu.org
2011-06-21 12:13 ` janus at gcc dot gnu.org
2011-06-21 12:21 ` janus at gcc dot gnu.org
2011-06-21 12:27 ` janus at gcc dot gnu.org
2011-06-27 16:30 ` jakub at gcc dot gnu.org
2011-06-27 17:46 ` janus at gcc dot gnu.org
2011-07-27 19:52 ` burnus at gcc dot gnu.org
2011-07-27 21:57 ` janus at gcc dot gnu.org
2011-07-31 10:25 ` janus at gcc dot gnu.org
2011-08-05 17:04 ` janus at gcc dot gnu.org
2011-08-05 17:07 ` janus 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-49112-4-r7dkwUxfnd@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).