re PR fortran/18869 (multiple common blocks in a single line rejected)

gcc/
PR fortran/18869
* match.c (gfc_match_common): Skip whitespace.

testsuite/
PR fortran/18869
* gfortran.dg/common_1.f90: New test.

From-SVN: r92064
This commit is contained in:
Tobias Schlüter 2004-12-12 22:12:00 +01:00 committed by Tobias Schlüter
parent c3d003d207
commit 23acf4d411
4 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-12-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18869
* match.c (gfc_match_common): Skip whitespace.
2004-12-12 Steven G. Kargl <kargls@comcast.net>
PR fortran/16581

View File

@ -2306,12 +2306,14 @@ gfc_match_common (void)
as = NULL;
}
gfc_gobble_whitespace ();
if (gfc_match_eos () == MATCH_YES)
goto done;
if (gfc_peek_char () == '/')
break;
if (gfc_match_char (',') != MATCH_YES)
goto syntax;
gfc_gobble_whitespace ();
if (gfc_peek_char () == '/')
break;
}

View File

@ -1,3 +1,8 @@
2004-12-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18869
* gfortran.dg/common_1.f90: New test.
2004-12-12 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>

View File

@ -0,0 +1,21 @@
! { dg-do compile }
! tests various allowed variants of the common statement
! inspired by PR 18869
! blank common block
common x
common y, z
common // xx
! one named common block on a line
common /a/ e
! appending to a common block
common /a/ g
! several named common blocks on a line
common /foo/ a, /bar/ b ! note 'a' is also the name of the
! above common block
common /baz/ c /foobar/ d, /bazbar/ f
end