[Bug fortran/34402] Diagnose illegal initialization of derived type containing allocatable component
dfranke at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Dec 8 21:42:00 GMT 2009
------- Comment #4 from dfranke at gcc dot gnu dot org 2009-12-08 21:41 -------
(In reply to comment #3)
> (In reply to comment #2)
> > I don't get it. "Fortran 95/2003 explained" by Metcalf has exactly this in the
> > example (figure 12.3, p243) for allocatable components... So, where's the actual problem?
>
> The example on p243 correctly shows the use of a structure constructor in an
> assignment statement. This bug report is different in that it concerns a
> structure constructor in the initializer portion of a TYPE statement (where
> the derived type contains an ALLOCATABLE.)
And while writing the above, I didn't take this as significant difference.
However, it dawns on me that the crucial point is, that variables with
initializer get the SAVE attribute which doesn't go well with the ALLOCATABLE
components. Correct?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34402
More information about the Gcc-bugs
mailing list