1! { dg-do run } 2! 3! Test the fix for the array version of PR64757. 4! 5! Based on by Michael Lee Rilee <mike@rilee.net> 6! 7 type :: Test 8 integer :: i 9 end type 10 11 type :: TestReference 12 class(Test), allocatable :: test(:) 13 end type 14 15 type(TestReference) :: testList 16 type(test), allocatable :: x(:) 17 18 testList = TestReference([Test(99), Test(199)]) ! Gave: The rank of the element in the 19 ! structure constructor at (1) does not 20 ! match that of the component (1/0) 21! allocate (testList%test(2), source = [Test(99), Test(199)]) ! Works, of course 22 23 x = testList%test 24 25 select type (y => testList%test) ! Check vptr set 26 type is (Test) 27 if (any(x%i .ne. y%i)) call abort 28 class default 29 call abort 30 end select 31end 32 33 34