re PR fortran/19936 (confused error message about implied do loop)
authorSteven G. Kargl <kargls@comcast.net>
Sat, 5 Mar 2005 23:35:44 +0000 (23:35 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 5 Mar 2005 23:35:44 +0000 (23:35 +0000)
 PR 19936
* primary.c (match_complex_constant): Mangled complex constant may
be an implied do-loop.  Give implied do-loop matcher a chance.

From-SVN: r95951

gcc/fortran/ChangeLog
gcc/fortran/primary.c

index 514b29ad3460fa283ba3dc177b9b96282fecb19e..a39f8a5c3702ae6ec9f6d4f7c169ce463398d3b6 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-05  Steven G. Kargl  <kargls@comcast.net>
+
+       PR 19936
+       * primary.c (match_complex_constant): Mangled complex constant may
+       be an implied do-loop.  Give implied do-loop matcher a chance.
+
+
 2005-03-05  Steven G. Kargl  <kargls@comcast.net> 
 
        PR fortran/19754
index b87d72a1830ae265b3a9ea85031ac15c1d000fa9..992bc5f0af7982067d0c57042d996f1893a2bf5a 100644 (file)
@@ -1074,7 +1074,17 @@ match_complex_constant (gfc_expr ** result)
 
   m = gfc_match_char (')');
   if (m == MATCH_NO)
+    {
+      /* Give the matcher for implied do-loops a chance to run.  This
+        yields a much saner error message for (/ (i, 4=i, 6) /).  */
+      if (gfc_peek_char () == '=')
+       {
+         m = MATCH_ERROR;
+         goto cleanup;
+       }
+      else
     goto syntax;
+    }
 
   if (m == MATCH_ERROR)
     goto cleanup;