23 lines · plain
1! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s2! Ensure that EOSHIFT's ARRAY= argument and result can be CLASS(*).3! CHECK-NOT: error:4! CHECK: warning: Source of TRANSFER is polymorphic5! CHECK: warning: Mold of TRANSFER is polymorphic6program p7 type base8 integer j9 end type10 type, extends(base) :: extended11 integer k12 end type13 class(base), allocatable :: polyArray(:,:,:)14 class(*), allocatable :: unlimited(:)15 allocate(polyArray, source=reshape([(extended(n,n-1),n=1,8)],[2,2,2]))16 allocate(unlimited, source=[(base(9),n=1,16)])17 select type (x => eoshift(transfer(polyArray, unlimited), -4, base(-1)))18 type is (base); print *, 'base', x19 type is (extended); print *, 'extended?', x20 class default; print *, 'class default??'21 end select22end23