2011-02-12 Janus Weil <janus@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_7.f03
blobd7f1c835ef4272546dc3b0c123891402ba1ec89b
1 ! { dg-do compile }
2 ! Test fixes for PR41587 and PR41608.
4 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
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 ! FIXME: uncomment and dejagnuify once class arrays are enabled
13 !    class(t0), allocatable :: foo(3)  ! { "deferred shape" }
14   end type t
16 ! PR41608: Would ICE on missing type decl
17   class(t1), pointer :: c  ! { dg-error "before it is defined" }
19   select type (c)          ! { dg-error "shall be polymorphic" }
20     type is (t0)
21   end select
22 end