]> gcc.gnu.org Git - gcc.git/commitdiff
parse.c (gfc_statement_next_fixed): (Change from Andy's tree) Detect bad continuation...
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Fri, 14 May 2004 14:04:36 +0000 (16:04 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Fri, 14 May 2004 14:04:36 +0000 (16:04 +0200)
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

gcc/fortran/ChangeLog
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/noncontinuation_1.f90 [new file with mode: 0644]

index f5dd778b1ab69cb5bf4b1917a3ae67f17b2c62a8..a57c207abfe10dfe295cd311bc63417526cadcdf 100644 (file)
@@ -1,3 +1,8 @@
+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
index 1ab5b6aa5cdf36f714842f09b82ce1e585c9c0b2..beec9d622ba3c2e3689f5f1685eb6db2c5ff519c 100644 (file)
@@ -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.  */
index 216d3e8c205a1c33d217b7a34693f28bcc688585..eb609b052209bc743cc27175f3feb24c40437993 100644 (file)
@@ -1,3 +1,8 @@
+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
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 (file)
index 0000000..5921f01
--- /dev/null
@@ -0,0 +1,3 @@
+! verifies that 0 in column six doesn't start a continuation line
+!234567890
+     0 END
This page took 0.10175 seconds and 5 git commands to generate.