Is this a bug in Gfortran or rather illegal code, see below.
Reproducible both with 4.3.2 and 4.4 snapshot
GNU Fortran (Ubuntu 20081024-0ubuntu1) 4.4.0 20081024 (experimental)
[trunk revision 141342]
Alexei
alexei@lx01:~/darcs/ttfs-mac$ gfortran m.f90
m.f90:18.16:
type :: t3
1
Error: The component 'j' is a PRIVATE type and cannot be a component
of 't3', which is PUBLIC at (1)
alexei@lx01:~/darcs/ttfs-mac$ cat m.f90
module m
implicit none
private
type :: t1
integer :: i
end type
type :: t2
type(t1) :: j
end type
contains
subroutine sub()
implicit none
type :: t3
type(t1) :: j
end type
end subroutine
end module
Seems to be a bug in gfortran ...
Tobias Burnus posted it in the gcc bug database as PR39800 -
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39800
You have exposed two bugs - one is F95 and the other is F2003. Please
see PR39800.
Thanks for the report - could you try to post in gcc Bugzilla next
time, please?
Paul
I am impressed. Here maybe another one:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39876
Using module procedure names that collide with the GNU intrinsic
extensions
is not possible even with -std=f95:
alexei@novo:~/$ gfortran -c -std=f95 p.f90
p.f90:19.19:
print *, avg(erfc)
1
Error: Intrinsic 'erfc' at (1) is not allowed as an actual argument
p.f90:19.19:
print *, avg(erfc)
1
Error: Type/rank mismatch in argument 'f' at (1)