From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10065 invoked by alias); 25 Sep 2006 15:47:11 -0000 Received: (qmail 10033 invoked by uid 48); 25 Sep 2006 15:47:03 -0000 Date: Mon, 25 Sep 2006 15:47:00 -0000 Subject: [Bug fortran/29216] New: Derived type components of function results are not initialised X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "stephan dot kramer at imperial dot ac dot uk" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg02346.txt.bz2 List-Id: The derived type components of function results are not initialised according to their initialisation statements. This follows from the following code: program test implicit none type A integer, pointer:: p => null() integer:: i=3 end type A type(A):: x,y print *,associated(x%p), x%i x=f() print *,associated(x%p), x%i contains function f() type(A):: f print *, associated(f%p), f%i end function f end program and run-time output: F 3 T -1073745616 T -1073745616 -- Summary: Derived type components of function results are not initialised Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: stephan dot kramer at imperial dot ac dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29216