https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98022
--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to kargl from comment #4) > (In reply to Paul Thomas from comment #3) > > > 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 > > Are you sure that this is valid Fortran? I cannot > find anything in the Fortran standard that says hm%im > is defined. Thus, 'hm2=hm' is referencing a variable > that is no completely defined. > > > 19.6.1 Definition of objects and subobjects > > 2 Arrays, including sections, and variables of derived, character, > or complex type are objects that consist of zero or more subobjects. > Associations may be established between variables and subobjects and > between subobjects of different variables. These subobjects may become > defined or undefined. > > 5 A complex or character scalar object is defined if and only if all > of its subobjects are defined. Hi Steve, I saw your comment a bit too late. I think that you are correct. I guess that, at very least, I should not zero out the undefined part of the complex object? That way it would be equivalent to using assignment to achieve the same thing or to partially define a derived type. I'll post on clf. Cheers Paul