From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11251 invoked by alias); 4 Feb 2007 13:17:34 -0000 Received: (qmail 11220 invoked by uid 48); 4 Feb 2007 13:17:24 -0000 Date: Sun, 04 Feb 2007 13:17:00 -0000 Message-ID: <20070204131724.11219.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/30660] [4.2 and 4.1 only] Allocatable components of a derived type "require" the SAVE attribute. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "toon at moene dot indiv dot nluug dot nl" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-02/txt/msg00609.txt.bz2 ------- 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