Bug 29643 - Fortran 2003: Support USE with rename-list (local-name => use-name)
Summary: Fortran 2003: Support USE with rename-list (local-name => use-name)
Status: RESOLVED DUPLICATE of bug 25707
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-30 09:49 UTC by Tobias Burnus
Modified: 2006-10-30 12:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2006-10-30 09:49:48 UTC
Supported by, e.g., ifort and sunf95. (Not yet by g95 and NAG f95.)

Example:
----------------------
module test
  implicit none
  real,parameter :: pi = 3.1415926535897932385
end module test

program usetest
  use :: test, mypi => pi
  real :: pi
  pi = 3.0
  print *, mypi, pi ! Shall print "3.1415927 3.0"
end program usetest
----------------------

See Fortran 2003:

"11.2.1 The USE statement and use association"

"
R1109 use-stmt is USE [ [ , module-nature ] :: ] module-name [ , rename-list ]
          or USE [ [ , module-nature ] :: ] module-name , ONLY : [ only-list ]

R1111 rename is local-name => use-name
       or OPERATOR (local-defined-operator) => OPERATOR (use-defined-operator)

R1112 only is generic-spec
           or only-use-name
           or rename"
Comment 1 Francois-Xavier Coudert 2006-10-30 12:16:00 UTC
The rename-list works, it's only the F2003 "USE ::" that prevents it in your example. This is already tracked by PR 25707, and I submitted a patch to fix this (see http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01539.html).

*** This bug has been marked as a duplicate of 25707 ***