re PR fortran/34997 (Mention -fdollar-ok option in error message for symbol names containing $)

2008-02-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34997
        * match.c (gfc_match_name): Improve error message for '$'.

2008-02-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34997
        * gfortran.dg/dollar_sym_1.f90: New.
        * gfortran.dg/dollar_sym_2.f90: New.

From-SVN: r132488
This commit is contained in:
Tobias Burnus 2008-02-20 19:21:14 +01:00 committed by Tobias Burnus
parent 4cd8e76f1d
commit 89a5afda0e
5 changed files with 38 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-02-20 Tobias Burnus <burnus@net-b.de>
PR fortran/34997
* match.c (gfc_match_name): Improve error message for '$'.
2008-02-19 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35030

View file

@ -519,6 +519,13 @@ gfc_match_name (char *buffer)
}
while (ISALNUM (c) || c == '_' || (gfc_option.flag_dollar_ok && c == '$'));
if (c == '$' && !gfc_option.flag_dollar_ok)
{
gfc_error ("Invalid character '$' at %C. Use -fdollar-ok to allow it as an extension");
return MATCH_ERROR;
}
buffer[i] = '\0';
gfc_current_locus = old_loc;

View file

@ -1,3 +1,9 @@
2008-02-20 Tobias Burnus <burnus@net-b.de>
PR fortran/34997
* gfortran.dg/dollar_sym_1.f90: New.
* gfortran.dg/dollar_sym_2.f90: New.
2008-02-20 Richard Guenther <rguenther@suse.de>
PR middle-end/35265

View file

@ -0,0 +1,9 @@
! { dg-do compile }
! PR fortran/34997
! Variable names containing $ signs
!
REAL*4 PLT$C_HOUSTPIX ! { dg-error "Invalid character '\\$'" }
INTEGER PLT$C_COMMAND ! { dg-error "Invalid character '\\$'" }
PARAMETER (PLT$B_OPC=0) ! { dg-error "Invalid character '\\$'" }
common /abc$def/ PLT$C_HOUSTPIX, PLT$C_COMMAND ! { dg-error "Invalid character '\\$'" }
end

View file

@ -0,0 +1,11 @@
! { dg-do compile }
! { dg-options "-fdollar-ok" }
!
! PR fortran/34997
! Variable names containing $ signs
!
REAL*4 PLT$C_HOUSTPIX
INTEGER PLT$C_COMMAND
PARAMETER (PLT$B_OPC=0)
common /abc$def/ PLT$C_HOUSTPIX, PLT$C_COMMAND
end