re PR fortran/24640 ([4.1] ice with invalid label)

PR fortran/24640
* parse.c (next_free): Check for whitespace after the label.
* match.c (gfc_match_small_literal_int): Initialize cnt variable.

* gfortran.dg/label_2.f90: New test.

From-SVN: r109246
This commit is contained in:
Steven G. Kargl 2006-01-02 22:23:35 +00:00 committed by Steven G. Kargl
parent a9cc9cc69a
commit 99f1e97091
5 changed files with 26 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-01-02 Steven G. Kargl <kargls@comcast.net>
PR fortran/24640
* parse.c (next_free): Check for whitespace after the label.
* match.c (gfc_match_small_literal_int): Initialize cnt variable.
2006-01-01 Steven G. Kargl <kargls@comcast.net>
* ChangeLog: Split previous years into ...

View file

@ -151,6 +151,7 @@ gfc_match_small_literal_int (int *value, int *cnt)
gfc_gobble_whitespace ();
c = gfc_next_char ();
*cnt = 0;
if (!ISDIGIT (c))
{

View file

@ -334,6 +334,10 @@ next_free (void)
do
c = gfc_next_char ();
while (ISDIGIT(c));
if (!gfc_is_whitespace (c))
gfc_error_now ("Non-numeric character in statement label at %C");
}
else
{

View file

@ -1,3 +1,8 @@
2006-01-02 Steven G. Kargl <kargls@comcast.net>
PR fortran/24640
* gfortran.dg/label_2.f90: New test.
2006-01-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* g++.dg/lookup/using12.C: Tighten error marker.

View file

@ -0,0 +1,10 @@
! { dg-do compile }
! PR fortran/24640. We needed to check that whitespace follows
! a statement label in free form.
!
program pr24640
10: a=10 ! { dg-error "character in statement" }
end program