Commit 4d08533c by Thomas Koenig Committed by Thomas Koenig

re PR fortran/23151 (print (buf, format), expression should be invalid)

2006-05-26  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/23151
	* io.c (match_io):  print (1,*) is an error.

2006-05-26  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/23151
	* gfortran.dg/inquire_9.f90:  Fix illegal print syntax.
	* gfortran.dg/print_parentheses_1.f:  New test.
	* gfortran.dg/print_parentheses_2.f90:  New test.

From-SVN: r114138
parent dd46a4de
2006-05-26 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/23151
* io.c (match_io): print (1,*) is an error.
2006-05-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/27709
......
......@@ -2424,6 +2424,12 @@ match_io (io_kind k)
dt->io_unit = default_unit (k);
goto get_io_list;
}
else
{
/* Error for constructs like print (1,*). */
if (k == M_PRINT)
goto syntax;
}
/* Match a control list */
if (match_dt_element (k, dt) == MATCH_YES)
......
2006-05-26 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/23151
* gfortran.dg/inquire_9.f90: Fix illegal print syntax.
* gfortran.dg/print_parentheses_1.f: New test.
* gfortran.dg/print_parentheses_2.f90: New test.
2006-05-26 Jakub Jelinek <jakub@redhat.com>
PR target/27758
......@@ -8,7 +8,7 @@
inquire (unit=-16, exist=l)
if (l) call abort
open (unit=16, file='inquire_9.tst')
print (unit=16, fmt='(a)'), 'Test'
write (unit=16, fmt='(a)') 'Test'
l = .false.
inquire (unit=16, exist=l)
if (.not.l) call abort
......
! { dg-do compile }
program main
character*80 line
print (line,'(A)'), 'hello' ! { dg-error "Syntax error" }
end
! { dg-do compile }
program main
character*80 line
print (line,'(A)'), 'hello' ! { dg-error "Syntax error" }
end program main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment