[J3] Question on Table 10.8: Intrinsic assignment type conformance

Robert Corbett rpcorbett at att.net
Fri Jun 14 01:43:29 EDT 2019


For the definition status of objects that have derived type, see 19.6.1 p4. Clearly, a scalar object of derived type that has no components is defined.  The derived types shown in your example all have components.

Robert Corbett

> On Jun 13, 2019, at 6:14 PM, Vipul Parekh via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> On Thu, Jun 13, 2019 at 6:55 PM Steve Lionel via J3
> <j3 at mailman.j3-fortran.org> wrote:
>> 
>> ..
>> Note the use of "declared type". The declared type of b and f() are both
>> b_t, so this conforms.
>> 
> 
> Thanks, Steve, for your input.  I'd noticed that the use of "declared
> type", I was wondering whether there was any additional interpretation
> anywhere else in the standard that came into play with this
> assignment.  There isn't any such considerations, it appears.
> 
>> As for the warning from the Cray compiler, it is correct. An ALLOCATE of
>> a variable without SOURCE= does not define the variable. See 19.6.5.
>> ..
> 
> That's good to know.  Again I was wondering if there was an item in
> section 19.6.5 toward derived types with zero components that I had
> failed to notice.  Upon reading "Allocation of a zero-sized array or
> zero-length character variable causes the array or variable to become
> defined." and with *sequence types*, "When all components of a
> structure of a numeric sequence type or character sequence type become
> defined as a result of partially associated objects becoming defined,
> the structure becomes defined," I became expectant of a consideration
> somewhere in the standard regarding a variable of a derived type with
> no components getting defined upon allocation.  That would only be
> common sense in my view.  But it must not be that simple and
> straightforward with derived types.
> 
> Regards,
> Vipul



More information about the J3 mailing list