From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11249 invoked by alias); 28 Oct 2009 22:32:45 -0000 Received: (qmail 11217 invoked by uid 48); 28 Oct 2009 22:32:32 -0000 Date: Wed, 28 Oct 2009 22:32:00 -0000 Message-ID: <20091028223232.11216.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/41859] ICE on invalid expression involving DT with pointer components in I/O In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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: 2009-10/txt/msg02411.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2009-10-28 22:32 ------- "If a list item of derived type in an unformatted input/output statement is not processed by a user-defined derived-type input/output procedure (9.5.3.7), and if any subobject of that list item would be processed by a user-defined derived-type input/output procedure, the list item is treated as if all of the components of the object were specified in the list in component order (4.5.3.5); those components shall be accessible in the scoping unit containing the input/output statement and shall not be pointers or allocatable. If a list item of derived type in a formatted input/output statement is not processed by a user-defined derived-type input/output procedure, that list item is treated as if all of the components of the list item were specified in the list in component order; those components shall be accessible in the scoping unit containing the input/output statement and shall not be pointers or allocatable. If a derived-type list item is not treated as a list of its individual components, that list item’s ultimate components shall not have the POINTER or ALLOCATABLE attribute unless that list item is processed by a user-defined derived-type input/output procedure." (F2003, 9.5.2). * * * Note: The scope issue is also violated as the following example shows. Other compilers get this right: error #7300: This derived-type object in an input-output list cannot have private components. Error: Data transfer element at (1) cannot have PRIVATE components Error: Derived type T in io-list has PRIVATE components module inputdom type t PRIVATE ! <<<<<<<<< integer :: i end type t end module module m use inputdom contains subroutine getstructinput() implicit none print *, (foo()) ! <<<<<<<<<< end subroutine function foo() type(t), pointer :: foo foo => null() end function foo end module m -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41859