Debian Codegraph @

gcc/testsuite/gfortran.dg/unlimited_polymorphic_9.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR 57639: [OOP] ICE with polymorphism (and illegal code)
4 !
5 ! Contributed by Walter Spector <[email protected]>
6
7 implicit none
8
9 class(*) :: t1, t2 ! { dg-error "must be dummy, allocatable or pointer" }
10
11 print *, 'main: compare = ', compare (t1, t2)
12 print *, SAME_TYPE_AS (t1, t2)
13
14 contains
15
16 logical function compare (a, b)
17 class(*), intent(in), allocatable :: a, b
18 end function
19
20 end