This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/62125] Nested select type not accepted (rejects valid)
- From: "mrestelli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jul 2016 17:00:27 +0000
- Subject: [Bug fortran/62125] Nested select type not accepted (rejects valid)
- Auto-submitted: auto-generated
- References: <bug-62125-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62125
--- Comment #9 from mrestelli <mrestelli at gmail dot com> ---
Here is a test; should compile and run without errors.
module m
implicit none
type, abstract :: t1
logical :: l
end type t1
type, extends(t1), abstract :: t2
integer :: i
end type t2
type, extends(t2) :: t3
real :: x
end type t3
contains
subroutine s(u)
class(t1), intent(in) :: u
if(.not.u%l) call abort()
select type(u); class is(t2)
if(u%i.ne.2) call abort()
select type(u); class is(t3)
if(u%x.ne.3.5) call abort()
end select
end select
end subroutine s
end module m
program p
use m
implicit none
type(t3) :: var = t3( l=.true. , i=2 , x=3.5 )
call s(var)
end program p