This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Procedure pointers not private to modules


The following code won't compile with the latest gfortran. I think it's valid 
code as the two procedure pointers should be private to their respective 
modules - unless I'm misunderstanding this.

module Module1
  implicit none
  private
  procedure(), pointer :: procPtr => null()
end module Module1

module Module2
  implicit none
  private
  procedure(), pointer :: procPtr => null()
end module Module2

program Test
  use Module1
  use Module2
  implicit none
end program Test


$ gfortran -v
Using built-in specs.
COLLECT_GCC=/home/abenson/gcc4.7/bin/gfortran
COLLECT_LTO_WRAPPER=/home/abenson/gcc4.7/libexec/gcc/x86_64-unknown-linux-
gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc4.7/configure --prefix=/home/abenson/gcc4.7 --enable-
languages=c,c++,fortran --disable-multilib --with-gmp=/home/abenson/gcc4.7 --
with-mpc=/home/abenson/gcc4.7 --with-mpfr=/home/abenson/gcc4.7
Thread model: posix
gcc version 4.8.0 20120407 (experimental) (GCC) 

$ gfortran test.F90
/tmp/ccuQNbu2.s: Assembler messages:
/tmp/ccuQNbu2.s:13: Error: symbol `procptr' is already defined

If anyone can confirm that it's valid code I'll go ahead and file a PR.

-Andrew

-- 

* Andrew Benson: http://www.tapir.caltech.edu/~abenson/contact.html

* Galacticus: http://sites.google.com/site/galacticusmodel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]