http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55117



--- Comment #6 from Walter Spector <w6ws at earthlink dot net> 2013-01-04 
14:33:15 UTC ---

Another manifestation of this problem is with type extension.  Here is another

small example which fails.  (Tested on v4.6.3 and also a 1/4/2013 snapshot of

the 4.8 trunk.):



program test_type_extension



  type t1_t

     real :: x

  end type t1_t



  type, extends(t1_t) :: t1e_t

     character(8) :: string

  end type t1e_t



  type(t1e_t) :: t1e



  integer :: answer

  namelist /test_NML/ t1e, answer



  open(unit=1,file='test1.inp')

  read(1,NML=test_NML)



  write(*,*) t1e%x, t1e%string, answer



end program test_type_extension



File test1.inp contains:



&test_NML

t1e%x = 2.,t1e%string='gfortran',answer=42

/



wws@w6ws-4:~/fortran/xxx$ gfortran --version

GNU Fortran (GCC) 4.8.0 20130104 (experimental)

Copyright (C) 2013 Free Software Foundation, Inc.



GNU Fortran comes with NO WARRANTY, to the extent permitted by law.

You may redistribute copies of GNU Fortran

under the terms of the GNU General Public License.

For more information about these matters, see the file named COPYING



wws@w6ws-4:~/fortran/xxx$ gfortran namelist.f90

wws@w6ws-4:~/fortran/xxx$ a.out

At line 17 of file namelist.f90 (unit = 1, file = 'test1.inp')

Fortran runtime error: Cannot match namelist object name %x



Backtrace for this error:

  + in the main program

    from file namelist.f90

  + /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ffe80c5376d]

wws@w6ws-4:~/fortran/xxx$



The NAG Fortran compiler has no problems with this test case.  (Intel and PGI

are not so lucky.  :) )

Reply via email to