[Bug fortran/69829] New: [OOP] Case label overlaps for unlimited polymorphic select type
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 15 20:58:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69829
Bug ID: 69829
Summary: [OOP] Case label overlaps for unlimited polymorphic
select type
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: tkoenig at gcc dot gnu.org
Target Milestone: ---
Test case by James Van Buskirk from c.l.f:
ig25@linux-fd1f:/tmp> /usr/bin/gfortran a.f90
a.f90:15.20:
type is(CS5SS)
1
a.f90:17.20:
type is(SQS3C)
2
Error: CASE label at (1) overlaps with CASE label at (2)
a.f90:26.7:
use types
1
Fatal Error: Can't open module file 'types.mod' for reading at (1): No such
file or directory
ig25@linux-fd1f:/tmp> cat a.f90
module types
implicit none
type CS5SS
integer x
real y
end type CS5SS
type SQS3C
logical u
character(7) v
end type SQS3C
contains
subroutine sub(x)
class(*), allocatable :: x
select type(x)
type is(CS5SS)
write(*,'(a)') 'TYPE IS CS5SS'
type is(SQS3C)
write(*,'(a)') 'TYPE IS SQS3C'
class default
write(*,'(a)') 'TYPE could not be determined'
end select
end subroutine sub
end module types
program test
use types
implicit none
class(*), allocatable :: u1, u2
allocate(u1,source = CS5SS(2,1.414))
allocate(u2,source = SQS3C(.TRUE.,'Message'))
call sub(u1)
call sub(u2)
end program test
More information about the Gcc-bugs
mailing list