http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52909

             Bug #: 52909
           Summary: Procedure pointers not private to modules
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: aben...@caltech.edu


The following code won't compile with the latest gfortran (or with 4.6 and
4.7). The two procedure pointers should be private to their respective modules
so there should be no symbol conflict.

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

Reply via email to