http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49213

--- Comment #5 from janus at gcc dot gnu.org 2011-06-16 21:29:07 UTC ---
(In reply to comment #4)
> An intuitive way of viewing (and maybe even implementing I guess) the process
> triggered by a structure constructor is as a sequence of assignment statements
> for the components of the structure.  But that's not how the (2008) standard
> describes what takes place, and so constraints that apply to assignments (like
> assigning to a polymorphic) don't apply in this context.

I think you are wrong here.

F08:7.2.1.3p13:

"An intrinsic assignment where the variable is of derived type is performed as
if each component of the variable were assigned from the corresponding
component of expr using pointer assignment (7.2.2) for each pointer component,
defined assignment for each nonpointer nonallocatable component of a type that
has a type-bound defined assignment consistent with the component, intrinsic
assignment for each other nonpointer nonallocatable component, and intrinsic
assignment for each allocated coarray component. For unallocated coarray
components, the corresponding component of the variable shall be unallocated.
For a noncoarray allocatable component the following sequence of operations is
applied."

In essence this means that a derived type assignment *is* viewed as a sequence
of component assignments. Therefore I think that the corresponding restrictions
*do* apply.

Reply via email to