3 ! Tests the fix for PR82275.
4 ! Associating a name with a reduced-dimension section of a
5 ! multidimensional array precluded subsequent use of the name
6 ! with the appropriately reduced dimensionality and instead
7 ! required use of the (invalid) full set of original dimensions.
9 ! Contributed by Damian Rouson <damian@sourceryinstitute.org>
15 class(component
), allocatable
:: component_array(:,:)
18 type(component
) section_copy
19 allocate(bag
%component_array
, source
= reshape ([component(10), component (100)], [1,2]))
20 select
type(associate_name
=>bag
%component_array(1,:))
22 section_copy
= associate_name(2) ! gfortran rejected valid
23 ! section_copy = associate_name(1,1)! gfortran accepted invalid
25 if (section_copy
%i
.ne
. 100) stop 1