Bug 29643

Summary: Fortran 2003: Support USE with rename-list (local-name => use-name)
Product: gcc Reporter: Tobias Burnus <burnus>
Component: fortranAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: burnus, fxcoudert, gcc-bugs
Priority: P3    
Version: 4.3.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

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 ***