diff options
author | Tobias Burnus <burnus@net-b.de> | 2008-02-20 19:21:14 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2008-02-20 19:21:14 +0100 |
commit | 89a5afda0e8c61e452cf46f305658d3f01117aba (patch) | |
tree | e68e064de125857eee91b9fe22ed75bed60f1fa5 /gcc/fortran/match.c | |
parent | 4cd8e76f1d5a3023e1faed30cef00270103c330d (diff) | |
download | gcc-89a5afda0e8c61e452cf46f305658d3f01117aba.tar.gz |
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
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 324e52ecee0..c1920ff9d58 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -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; |