re PR fortran/28224 (gfortran should support namelist (nml) for internal file units)

fortran/
2006-10-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/28224
	* io.c (check_io_constraints): Allow namelists
	  for internal files for Fortran 2003.

testsuite/
2006-10-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/28224
	* gfortran.dg/io_constraints_2.f90: Use -std=f95.
	* gfortran.dg/namelist_internal.f90: New test.

From-SVN: r118113
This commit is contained in:
Tobias Burnus 2006-10-28 23:59:20 +02:00 committed by Tobias Burnus
parent 0a3a2b91a5
commit f1827a8c69
5 changed files with 43 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2006-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/28224
* io.c (check_io_constraints): Allow namelists
for internal files for Fortran 2003.
2006-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/27954

View File

@ -2596,9 +2596,13 @@ if (condition) \
"REC tag at %L is incompatible with internal file",
&dt->rec->where);
io_constraint (dt->namelist != NULL,
"Internal file at %L is incompatible with namelist",
&expr->where);
if (dt->namelist != NULL)
{
if (gfc_notify_std(GFC_STD_F2003,
"Internal file at %L is incompatible with namelist",
&expr->where) == FAILURE)
m = MATCH_ERROR;
}
io_constraint (dt->advance != NULL,
"ADVANCE tag at %L is incompatible with internal file",

View File

@ -1,4 +1,10 @@
2006-10-28 Tobias Burnus <burnus@net-b.de>
2006-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/28224
* gfortran.dg/io_constraints_2.f90: Use -std=f95.
* gfortran.dg/namelist_internal.f90: New test.
2006-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/29625
* gfortran.dg/io_real_boz.f90: Add.

View File

@ -1,4 +1,5 @@
! { dg-do compile }
! { dg-options "-std=f95" }
! Part II of the test of the IO constraints patch, which fixes PRs:
! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862.
! Modified2006-07-08 to check the patch for PR20844.
@ -35,7 +36,7 @@ end module global
write(*, NML=NL) z ! { dg-error "followed by IO-list" }
!Was correctly picked up before patch.
print NL, z ! { dg-error "followed by IO-list" }
print NL, z ! { dg-error "PRINT namelist at \\(1\\) is an extension" }
!
! Not allowed with internal unit
!Was correctly picked up before patch.

View File

@ -0,0 +1,21 @@
! { dg-do run }
! { dg-options "-fall-intrinsics -std=f2003" }
! Checks internal file read/write of namelists
! (Fortran 2003 feature)
! PR fortran/28224
program nml_internal
integer :: i, j
real :: r
namelist /nam/ i, j, r
character(len=250) :: str
i = 42
j = -718
r = exp(1.0)
write(str,nml=nam)
i = -33
j = 10
r = sin(1.0)
read(str,nml=nam)
if(i /= 42 .or. j /= -718 .or. abs(r-exp(1.0)) > 1e-5) call abort()
end program nml_internal