https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98022
--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> --- Created attachment 49722 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49722&action=edit Tentative patch for the PR The attached regtests OK and the following runs correctly: module ur contains function kn1() result(hm2) complex :: hm(1:2), hm2(1:2) data (hm(md)%re, md=1,2)/1.0, 2.0/ hm2 = hm end function kn1 function kn2() result(hm2) complex :: hm(1:2), hm2(1:2) data (hm(md)%im, md=1,2)/1.0, 2.0/ hm2 = hm end function kn2 end module ur use ur if (any (kn1() .ne. [(1.0,0.0),(2.0,0.0)])) stop 1 if (any (kn2() .ne. [(0.0,1.0),(0.0,2.0)])) stop 2 end I have yet to test inquiry references of derived type components. I suspect that a bit more work is needed. Watch this space Paul