3 ! PR 43207: [OOP] invalid (pointer) assignment to and from abstract non-polymorphic expressions
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
8 type, abstract
:: parent
11 type, extends(parent
) :: child
12 class(parent
), pointer :: comp
15 type(child
), target
:: c1
16 class(child
), allocatable
:: c2
17 class(parent
), pointer :: cp
19 c1
%parent
= c1
%parent
! { dg-error "Nonpolymorphic reference to abstract type" }
20 c2
%parent
= c1
%parent
! { dg-error "Nonpolymorphic reference to abstract type" }
23 cp
=> c1
%parent
! { dg-error "Nonpolymorphic reference to abstract type" }
26 call sub(c1
%parent
) ! { dg-error "Nonpolymorphic reference to abstract type" }