Debian Codegraph @

gcc/testsuite/gfortran.dg/class_7.f03

raw
1 ! { dg-do compile }
2 ! Test fixes for PR41587 and PR41608.
3 !
4 ! Contributed by Tobias Burnus <[email protected]>
5 !
6 ! PR41587: used to accept the declaration of component 'foo'
7 type t0
8 integer :: j = 42
9 end type t0
10 type t
11 integer :: i
12 class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" }
13 end type t
14
15 ! PR41608: Would ICE on missing type decl
16 class(t1), pointer :: c ! { dg-error "before it is defined" }
17
18 select type (c) ! { dg-error "shall be polymorphic" }
19 type is (t0)
20 end select
21 end