2 ! { dg-options "-fcoarray=single" }
9 ! Check for C1229: "A data-ref shall not be a polymorphic subobject of a
10 ! coindexed object." which applies to function and subroutine calls.
15 procedure
, nopass
:: sub
=>sub
16 procedure
, nopass
:: func
=>func
22 class(t
), allocatable
:: poly
23 class(t3
), allocatable
:: poly2
37 call x
[1]%poly2
%nopoly
%sub() ! OK
38 i
= x
[1]%poly2
%nopoly
%func() ! OK
39 call x
[1]%poly
%sub() ! { dg-error "Polymorphic subobject of coindexed object" }
40 i
= x
[1]%poly
%func() ! { dg-error "Polymorphic subobject of coindexed object" }
44 ! Check for C617: "... a data-ref shall not be a polymorphic subobject of a
45 ! coindexed object or ..."
46 ! Before, the second allocate statment was failing - though it is no subobject.
50 class(t
), allocatable
:: a
[:]
51 allocate (t
:: a
) ! { dg-error "Coarray specification required in ALLOCATE statement" }
52 allocate (t
:: a
[*]) ! OK