From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25703 invoked by alias); 31 Jul 2013 19:15:55 -0000 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 Received: (qmail 25577 invoked by uid 48); 31 Jul 2013 19:15:51 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57710] [OOP] [F08] _vptr not set for allocatable CLASS component inside BLOCK Date: Wed, 31 Jul 2013 19:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg01572.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57710 --- Comment #4 from janus at gcc dot gnu.org --- (In reply to janus from comment #2) > Can't we do a 'static' initialization (of _vptr *and* _data) in both cases? > As in > > struct t2 y = {.x={._vptr=&__vtab_m_T,._data = 0B}} > > For this gfc_class_null_initializer (from class.c) could be used ... ... we would just have to enable this for the BLOCK case in gfc_get_symbol decl. However, I'm not sure if this is really the way to go. Otherwise, one should do the (non-static) initialization of the _vptr via gfc_nullify_alloc_comp.