diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-05-14 16:04:36 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-05-14 16:04:36 +0200 |
commit | 5b5afddf1d3af9d2512fb23f420c29baa7fa1fba (patch) | |
tree | 1b42e6e8d8f870eb9eef9d6ac3e7bb409cf3ad38 /gcc | |
parent | 9bc856ddbfbb72ad01f2350ded06d7713781f645 (diff) | |
download | gcc-5b5afddf1d3af9d2512fb23f420c29baa7fa1fba.zip gcc-5b5afddf1d3af9d2512fb23f420c29baa7fa1fba.tar.gz gcc-5b5afddf1d3af9d2512fb23f420c29baa7fa1fba.tar.bz2 |
parse.c (gfc_statement_next_fixed): (Change from Andy's tree) Detect bad continuation line in fixed form sources.
fortran:
* parse.c (gfc_statement_next_fixed): (Change from Andy's tree)
Detect bad continuation line in fixed form sources.
testsuite:
* gfortran.fortran-torture/compile/noncontinuation_1.f90: New
test.
From-SVN: r81845
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/compile/noncontinuation_1.f90 | 3 |
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f5dd778..a57c207 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2004-05-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + * parse.c (gfc_statement_next_fixed): (Change from Andy's tree) + Detect bad continuation line in fixed form sources. + +2004-05-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + PR fortran/15205 * iresolve.c (gfc_resolve_nearest): Add new function. * intrinsic.h: ... declare it here. diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 1ab5b6a..beec9d6 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -420,11 +420,20 @@ next_fixed (void) } /* Since this line starts a statement, it cannot be a continuation - of a previous statement. Hence we mostly ignore column 6. */ + of a previous statement. If we see something here besides a + space or zero, it must be a bad continuation line. */ - if (gfc_next_char_literal (0) == '\n') + c = gfc_next_char_literal (0); + if (c == '\n') goto blank_line; + if (c != ' ' && c!= '0') + { + gfc_buffer_error (0); + gfc_error ("Bad continuation line at %C"); + return ST_NONE; + } + /* Now that we've taken care of the statement label columns, we have to make sure that the first nonblank character is not a '!'. If it is, the rest of the line is a comment. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 216d3e8..eb609b0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2004-05-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + * gfortran.fortran-torture/compile/noncontinuation_1.f90: New + test. + +2004-05-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + PR fortran/14066 * gfortran.fortran-torture/compile/do_1.f90: New test. diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/noncontinuation_1.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/noncontinuation_1.f90 new file mode 100644 index 0000000..5921f01 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/noncontinuation_1.f90 @@ -0,0 +1,3 @@ +! verifies that 0 in column six doesn't start a continuation line +!234567890 + 0 END |