re PR fortran/27698 (subroutine _foo draws "unclassifiable statement" instead of a useful error.)

fortran/ChangeLog

2007-01-03  Bernhard Fischer  <aldot@gcc.gnu.org>

        PR fortran/27698
        * match.c (gfc_match_name): Print diagnostics for invalid character
        in names.


testsuite/ChangeLog

2007-01-03  Bernhard Fischer  <aldot@gcc.gnu.org>

        PR fortran/27698
        * gfortran.dg/invalid_name.f90: New test.
        * gfortran.dg/do_iterator.f90: Adjust pattern for expected error.
        * gfortran.dg/gomp/pr29759.f90: Ditto.

From-SVN: r120549
This commit is contained in:
Bernhard Fischer 2007-01-07 17:23:45 +01:00 committed by Bernhard Reutner-Fischer
parent b881887e66
commit be58af47f2
6 changed files with 26 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2007-01-07 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/27698
* match.c (gfc_match_name): Print diagnostics for invalid
character in names.
2007-01-06 Steven G. Kargl <kargl@gcc.gnu.org>
* array.c: Fix whitespace in comment table.

View File

@ -396,6 +396,8 @@ gfc_match_name (char *buffer)
c = gfc_next_char ();
if (!ISALPHA (c))
{
if (gfc_error_flag_test() == 0)
gfc_error ("Invalid character in name at %C");
gfc_current_locus = old_loc;
return MATCH_NO;
}

View File

@ -1,3 +1,10 @@
2007-01-07 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/27698
* gfortran.dg/invalid_name.f90: New test.
* gfortran.dg/do_iterator.f90: Adjust pattern for expected error.
* gfortran.dg/gomp/pr29759.f90: Ditto.
2007-01-06 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/present_1.f90: Update error message.

View File

@ -10,4 +10,4 @@ DO I=1,5 ! { dg-error "cannot be redefined" "changing do-iterator 3" }
READ(5,*,iostat=i) j ! { dg-error "cannot be redefined" "changing do-iterator 3" }
ENDDO
END
! { dg-error "Invalid character" "character" { target *-*-* } 7 }

View File

@ -22,21 +22,21 @@ PROGRAM test_omp
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!$ NUM_THREADS(2) ! { dg-error "Unclassifiable" }
!$ NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable" }
!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!
!$ NUM_THREADS(2) ! { dg-error "Unclassifiable" }
!$ NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!
!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable" }
!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
END PROGRAM

View File

@ -0,0 +1,6 @@
! { dg-do compile }
! Tests the fix for PR27698, where names not starting with a letter were
! rejected but not diagnosed with a proper message.
SUBROUTINE _foo ! { dg-error "Invalid character in name" }
END