From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8666 invoked by alias); 14 Oct 2010 08:09:33 -0000 Received: (qmail 8657 invoked by uid 22791); 14 Oct 2010 08:09:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Oct 2010 08:09:26 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46010] I/O: Namelist-reading bug X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 14 Oct 2010 08:09:00 -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 X-SW-Source: 2010-10/txt/msg01152.txt.bz2 Message-ID: <20101014080900.90OvZ-MHtNg5HCyRcoVGQZ51HoSABXNAfxRpXKaRoNY@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46010 --- Comment #4 from Tobias Burnus 2010-10-14 08:09:04 UTC --- Reduced test case: ----------nml.dat----------------------- &namtoptrc tracer(1) = 'Aa', .true. tracer(2) = 'Bb', .true. tracer(3) = 'Cc', .true. / ---------------------------------------- ----------test.f90---------------------- TYPE PTRACER CHARACTER(len = 2) :: sname LOGICAL :: lini END TYPE PTRACER TYPE(PTRACER) , DIMENSION(3) :: tracer NAMELIST/namtoptrc/ tracer open (99, file='nml.dat') read (99, nml=namtoptrc) write (*, nml=namtoptrc) end ---------------------------------------- Works with -std=f90/f2003/f2008 but fails with without -std=f* (i.e. with -std=gnu) as follows: At line 10 of file test.f90 (unit = 99, file = 'nml.dat') Fortran runtime error: Cannot match namelist object name 'bb' The issue is really the ".true." ("T","true", ".false.", "F", "false"). If the last item (in the namelist and in the derived type) is an integer or a string it works.