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/63744] [4.8/4.9/5 Regression] Duplicate use-statement causes error
Date: Sat, 15 Nov 2014 17:00:00 -0000	[thread overview]
Message-ID: <bug-63744-4-bRkusDl7Xy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63744-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63744

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|burnus@net-b.de             |

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #3)
> > 11.2.2 The USE statement and use association
> > ...
> > R1111 rename is local-name => use-name
> > ...
> > NOTE 11.9
> > There is no prohibition against a use-name or use-defined-operator appearing
> > multiple times in one USE statement or in multiple USE statements involving
> > the same module. As a result, it is possible for one use-associated entity
> > to be accessible by more than one local identier.

But that means things like:
  use m, only: A => X
  use m, only: B => X
which makes m's X (use-name) available under the names A and B (local-name).

In the case at hand, we have something more like:
  use m, only: A => X
  use m, only: A => Y
i.e. the LHS (local-name) is the same. In this example of mine A and A point to
a different object (X and Y), which is clearly ambiguous and invalid (at least
as soon as "A" is used). The question is whether it becomes valid if one uses:
  use m, only: A => X
  use m, only: A => X
i.e. the same object on the RHS.

The Fortran standard has:
"Within its scope, a local identifier of one class shall not be the same as
another local identifier of the same class, except that a generic name may be
the same as the name of a procedure as explained in 12.4.3.5 or the same as
the name of a derived type (4.5.10). A local identifier of one class may be the
same as a local identifier of another class." (F2015 draft, 14-007r2, 16.3.1)

And in the module section (11.2.2)
"Two or more accessible entities, other than generic interfaces or defined
operators, may have the same local identifier only if the identifier is not
used. Generic interfaces and defined operators are handled as described in
12.4.3.5. Except for these cases, the local identifier of any entity given
accessibility by a USE statement shall differ from the local identifiers of all
other entities accessible to the scoping unit."

I have to admit that I am unsure whether it is valid or not.


  parent reply	other threads:[~2014-11-15 17:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  8:46 [Bug fortran/63744] New: " roger.ferrer at bsc dot es
2014-11-15 15:06 ` [Bug fortran/63744] [4.8/4.9/5 Regression] " dominiq at lps dot ens.fr
2014-11-15 15:42 ` burnus at gcc dot gnu.org
2014-11-15 16:14 ` dominiq at lps dot ens.fr
2014-11-15 17:00 ` burnus at gcc dot gnu.org [this message]
2014-11-15 17:04 ` dominiq at lps dot ens.fr
2014-11-19 13:28 ` rguenth at gcc dot gnu.org
2014-11-20 11:36 ` jakub at gcc dot gnu.org
2014-12-19 13:44 ` jakub at gcc dot gnu.org
2015-02-03 14:49 ` mikael at gcc dot gnu.org
2015-02-06 20:01 ` mikael at gcc dot gnu.org
2015-02-08 14:18 ` mikael at gcc dot gnu.org
2015-02-13 18:49 ` mikael at gcc dot gnu.org
2015-02-13 19:34 ` mikael at gcc dot gnu.org
2015-02-13 20:07 ` mikael 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-63744-4-bRkusDl7Xy@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).