This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Symbol has no implicit type bug
- From: Andrew Benson <abenson at its dot caltech dot edu>
- To: gfortran <fortran at gcc dot gnu dot org>
- Date: Mon, 26 Mar 2012 10:58:21 -0700
- Subject: Symbol has no implicit type bug
Resending this, as the first attempt apparently failed.
--
Hi,
The following fails to compile with the latest gfortran 4.8 (r185768):
module testMod
type testType
end type testType
contains
subroutine testSub()
implicit none
procedure(double precision ), pointer :: r
class (testType ), pointer :: testObject
double precision :: testVal
select type (testObject)
class is (testType)
testVal=testFunc()
r => testFunc
end select
return
end subroutine testSub
double precision function testFunc()
implicit none
return
end function testFunc
end module testMod
$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/abenson/libexec/gcc/x86_64-unknown-linux-
gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7/configure --prefix=/home/abenson --enable-
languages=c,c++,fortran --disable-multilib --with-gmp=/home/abenson --with-
mpc=/home/abenson --with-mpfr=/home/abenson
Thread model: posix
gcc version 4.8.0 20120324 (experimental) (GCC)
$ gfortran -c test.F90 -o test.o
test.F90:16.23:
testVal=testFunc()
1
Error: Symbol 'testfunc' at (1) has no IMPLICIT type
Removing the "r => ...." line, removing the "select type", "class is" and "end
select" lines or moving testFunc before testSub in the file all allow the code
to compile successfully.
I don't see anything similar on bugzilla, so unless someone points out that
something in the above is invalid, I'll file a bug report.
-Andrew.