This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30660] [4.2 and 4.1 only] Allocatable components of a derived type "require" the SAVE attribute.
- From: "toon at moene dot indiv dot nluug dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Feb 2007 13:17:24 -0000
- Subject: [Bug fortran/30660] [4.2 and 4.1 only] Allocatable components of a derived type "require" the SAVE attribute.
- References: <bug-30660-109@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from toon at moene dot indiv dot nluug dot nl 2007-02-04 13:17 -------
It's not completely fixed yet, though.
The following:
MODULE types_m
TYPE coord_t
INTEGER ncord
REAL,ALLOCATABLE,DIMENSION(:) :: x, y
END TYPE
TYPE grib_t
INTEGER ksec0(2), ksec1(64), ksec2(64), ksec3(2), ksec4(64)
REAL psec2(512), psec3(3)
LOGICAL packed ! if packed then the data are stored in g_work
INTEGER npts
REAL,DIMENSION(:),ALLOCATABLE :: vdata
TYPE(coord_t) coords
END TYPE
END MODULE
MODULE globals_m
USE types_m
TYPE(grib_t) g_dest ! output field
END MODULE
still fails with:
globals.f90:21.21:
TYPE(grib_t) g_dest ! output field
1
Error: Object 'g_dest' at (1) must have the SAVE attribute for default
initialization of a component
probably because of the nested nature of the allocatable component in coord_t.
Hope this helps.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30660