1! { dg-do compile }
2!
3! PR 47728: [OOP] ICE on invalid CLASS declaration
4!
5! Contributed by Arjen Markus <arjen.markus@deltares.nl>
6
7program 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
22end program test_objects
23