1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C911 - abstract derived type can be used only when polymorphic
4 type, abstract
:: abstract
7 type, extends(abstract
) :: concrete
9 class(concrete
), allocatable
:: a(:)
11 type(concrete
) :: x(2)
14 call sub1(x(1)%a(1)) ! ok
15 call sub2(x(1)%a
) ! ok
16 !ERROR: Reference to object with abstract derived type 'abstract' must be polymorphic
17 call sub1(x(1)%abstract
) ! bad
18 !ERROR: Reference to object with abstract derived type 'abstract' must be polymorphic
19 call sub2(x
%abstract
) ! bad
20 !ERROR: Reference to object with abstract derived type 'abstract' must be polymorphic
21 call sub1(x(1)%a(1)%abstract
) ! bad
22 !ERROR: Reference to object with abstract derived type 'abstract' must be polymorphic
23 call sub2(x(1)%a
%abstract
) ! bad