Debian Codegraph @

gcc/testsuite/gfortran.dg/class_38.f03

raw
1 ! { dg-do compile }
2 !
3 ! PR 47728: [OOP] ICE on invalid CLASS declaration
4 !
5 ! Contributed by Arjen Markus <[email protected]>
6
7 program test_objects
8
9 implicit none
10
11 type, abstract :: shape
12 end type
13
14 type, extends(shape) :: rectangle
15 real :: width, height
16 end type
17
18 class(shape), dimension(2) :: object ! { dg-error "must be dummy, allocatable or pointer" }
19
20 object(1) = rectangle( 1.0, 2.0 ) ! { dg-error "Unclassifiable statement" }
21
22 end program test_objects