+2009-08-02 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/40853
+ * gfortran.dg/namelist_40.f90: Update error output.
+ * gfortran.dg/namelist_47.f90: Update error output.
+ * gfortran.dg/namelist_58.f90: New test.
+
2009-08-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/40881
end subroutine writenml
end program namelist_40
-! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" }
+! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%ch(\n|\r\n|\r)" }
! { dg-output "Missing colon in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" }
! { dg-output "Substring out of range for namelist variable x%m%ch(\n|\r\n|\r)" }
! { dg-output "Bad character in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" }
end subroutine writenml
end program namelist_47
-! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" }
+! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Missing colon in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Substring out of range for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Bad character in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
--- /dev/null
+! { dg-do run }
+! PR40853 Error in namelist IO.
+! Test case derived from example given in PR. < jvdelisle@gcc.gnu.org >
+program test
+ implicit none
+ type tao_title_struct
+ character(2) justify
+ end type
+ type tao_plot_page_struct
+ real shape_height_max
+ type (tao_title_struct) title ! Comment this line out and the bug goes away.
+ real size(2)
+ end type
+ type (tao_plot_page_struct) plot_page
+ namelist / params / plot_page
+ open (10, status="scratch")
+ write(10,'(a)')" ¶ms"
+ write(10,'(a)')" plot_page%size=5 , 2,"
+ write(10,'(a)')"/"
+ rewind(10)
+ read (10, nml = params)
+ if (any(plot_page%size .ne. (/ 5, 2 /))) call abort
+ close (10)
+end program
+