http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46010
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 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.