This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46371] [Coarray] [OOP] SELECT TYPE: scalar coarray variable is rejected
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 Nov 2011 16:41:54 +0000
- Subject: [Bug fortran/46371] [Coarray] [OOP] SELECT TYPE: scalar coarray variable is rejected
- Auto-submitted: auto-generated
- References: <bug-46371-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46371
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-24 16:41:54 UTC ---
Polymorphic array example: Todo check for validity and fix.
program p
use m
class(foo), allocatable :: o_bar(:)[:]
integer :: j
allocate(foo :: o_bar(5)[*])
select type(o_bar)
type is(foo)
j = o_bar(2)[1]%i
end select
!! FIXME: "type if (foo)" fails with:
!! Associate-name '__tmp_type_foo' at (1) is used as array
select type(a => o_bar)
type is (foo)
j = a(1)[1]%i
end select
!! FIXME: "a" should be a rank 0 not a rank 1
!! array
select type(a => o_bar(1))
type is (foo)
j = a[2]%i
end select
end program p