public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/63744] New: Duplicate use-statement causes error
@ 2014-11-05  8:46 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
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: roger.ferrer at bsc dot es @ 2014-11-05  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63744
           Summary: Duplicate use-statement causes error
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roger.ferrer at bsc dot es

Hi,

(I guess this is related to PR34657)

The following snippet is accepted by gfortran

-- test-ok.f90
MODULE MOO
    INTEGER :: S
END MODULE MOO

SUBROUTINE S1
    USE MOO, ONLY: X => S, X => S

    X = 1
END SUBROUTINE S1
-- end of test-ok.f90

but it is rejected if the program unit SUBROUTINE S1 is renamed to SUBROUTINE
S,
as shown below

-- test.f90
MODULE MOO
    INTEGER :: S
END MODULE MOO

SUBROUTINE S
    USE MOO, ONLY: X => S, X => S

    X = 1
END SUBROUTINE S
-- end of test.f90

$ gfortran -c test.f90
test.f90:6.8:

    USE MOO, ONLY: X => S, X => S
        1
Error: 's' of module 'moo', imported at (1), is also the name of the current
program unit
test.f90:8.5:

    X = 1
     1
Error: Name 'x' at (1) is an ambiguous reference to 's' from module 'moo'

Removing the second rename lets the code be accepted.

  USE MOO, ONLY: X => S

A similar behaviour is observed if we have two repeated USE-statements rather
than two repeated rename's in the rename-list

  USE MOO, ONLY: X => S
  USE MOO, ONLY: X => S

Kind regards,


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-02-13 20:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-05  8:46 [Bug fortran/63744] New: Duplicate use-statement causes error 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
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

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