http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46313
--- Comment #2 from Steve Kargl <sgk at troutmask dot apl.washington.edu>
2010-11-05 16:04:31 UTC ---
On Fri, Nov 05, 2010 at 03:46:14PM +0000, kargl at gcc dot gnu.org wrote:
>
> -fdump-parse-tree suggests that the parsing of class(t2) :: b1, b2
> is not picking up the renamed type.
>
I think allocate() is doing its job. This looks like class()
is getting confused by the rename.
module m1
type mytype
integer :: a(10) = 2
integer :: b(10) = 3
end type mytype
end module m1
module m2
type mytype
real :: a(10) = 8
real :: b(10) = 9
end type mytype
end module m2
program testing
use m1, t1 => mytype
use m2, t2 => mytype
implicit none
class(t1), allocatable :: a1
class(t2), allocatable :: b1
allocate(a1, b1)
print '(10(I0,1X))', a1%a
print '(10(I0,1X))', b1%b
end program testing
troutmask:sgk[203] gfc4x -o z tr.f90 && ./z
2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3