2 ! { dg-options "-fcoarray=lib" }
4 ! Valid code - but currently not implemented for -fcoarray=lib; single okay
9 integer, allocatable
:: a
13 type(t
), allocatable
:: caf2
[:]
15 type(t
), save :: caf
[*],x
19 x
%a
= caf
[4]%a
! OK, now
21 x
= y
%caf2
[5] ! OK, now
22 x
%a
= y
%caf2
[4]%a
! OK, now
23 x
%b
= y
%caf2
[4]%b
! OK
33 type(t
), allocatable
:: caf2
[:]
35 type(t
), save :: caf
[*],x
39 x
%a
= caf
[4]%a
! OK, now
42 x
%a
= y
%caf2
[4]%a
! OK, now
43 x
%b
= y
%caf2
[4]%b
! OK
52 type(t
), allocatable
:: caf2(:)[:]
54 type(t
), save :: caf(10)[*]
58 x(1) = caf(2)[4]%b
! OK
59 x(:) = caf(:)[4]%b
! OK now
61 x(1) = y
%caf2(2)[4]%b
! OK
62 x(:) = y
%caf2(:)[4]%b
! OK now
68 integer, allocatable
:: a
72 class(t
), allocatable
:: caf2
[:]
74 class(t
), allocatable
:: caf
[:] ! { dg-error "Sorry, allocatable/pointer components in polymorphic" }
78 !x = caf[4] ! Unsupported - and ICEs in resolve_ordinary_assign, cf. PR fortran/65397
79 x
%a
= caf
[4]%a
! OK, now
81 !x = y%caf2[5] ! Unsupported - and ICEs in resolve_ordinary_assign, cf. PR fortran/65397
82 x
%a
= y
%caf2
[4]%a
! Ok, now
83 x
%b
= y
%caf2
[4]%b
! OK
93 class(t
), allocatable
:: caf2
[:]
95 class(t
), save, allocatable
:: caf
[:] ! { dg-error "Sorry, allocatable/pointer components in polymorphic" }
99 !x = caf[4] ! OK - but ICEs in resolve_ordinary_assign, cf. PR fortran/65397
100 x
%a
= caf
[4]%a
! OK, now
102 !x = y%caf2[5] ! OK - but ICEs in resolve_ordinary_assign, cf. PR fortran/65397
103 x
%a
= y
%caf2
[4]%a
! OK, now
104 x
%b
= y
%caf2
[4]%b
! OK
113 class(t
), allocatable
:: caf2(:)[:]
115 class(t
), save, allocatable
:: caf(:)[:]
119 x(1) = caf(2)[4]%b
! OK
120 x(:) = caf(:)[4]%b
! OK now
122 x(1) = y
%caf2(2)[4]%b
! OK
123 x(:) = y
%caf2(:)[4]%b
! OK now