summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-14 14:04:36 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-14 14:04:36 +0000
commita41b5367cdd9202717e77d3e2f8eb0c8bc876455 (patch)
tree1b42e6e8d8f870eb9eef9d6ac3e7bb409cf3ad38 /gcc/fortran/parse.c
parente27c85d07d09e32230796c096ab9752b9a4c5dba (diff)
downloadppe42-gcc-a41b5367cdd9202717e77d3e2f8eb0c8bc876455.tar.gz
ppe42-gcc-a41b5367cdd9202717e77d3e2f8eb0c8bc876455.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81845 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 1ab5b6aa5cd..beec9d622ba 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. */
OpenPOWER on IntegriCloud