[Patch, Fortran] PR30973, disallow to reuse a module name or to use the module name on an ONLY clause of USE

Tobias Burnus burnus@net-b.de
Tue Feb 27 17:44:00 GMT 2007


:ADDPATCH fortran:

As Daniel Franke found out, the following gives no error:

PROGRAM test_foo
   USE foo, ONLY: x
   INTEGER :: foo
   foo = 1
END PROGRAM

as the module name does not get imported as symbol as soon as "ONLY:" is
specified (incl. zero symbols after only).

In addition, using
  USE mymod, only: mymod
is possible as is
  USE mymod, only: foo => mymod
and
  USE mymod, only: mymod => foo

The first two plainly make no sense. The third one has ambiguity problems.

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use.diff
Type: text/x-patch
Size: 2386 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070227/e45f22de/attachment.bin>


More information about the Fortran mailing list