re PR fortran/91372 (Error: Unclassifiable statement)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 5 Aug 2019 19:24:31 +0000 (19:24 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 5 Aug 2019 19:24:31 +0000 (19:24 +0000)
2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>

PR fortran/91372
* decl.c (gfc_match_data): Allow an implied do-loop to nestle against
DATA.

2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>

PR fortran/91372
* gfortran.dg/pr91372.f90: New test.

From-SVN: r274122

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr91372.f90 [new file with mode: 0644]

index 534ae35..9835cbb 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/91372
+       * decl.c (gfc_match_data): Allow an implied do-loop to nestle against
+       DATA.
+
 2019-08-04  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/88227
index 1415b97..7a442ca 100644 (file)
@@ -624,9 +624,10 @@ gfc_match_data (void)
   char c;
 
   /* DATA has been matched.  In free form source code, the next character
-     needs to be whitespace.  Check that here.  */
+     needs to be whitespace or '(' from an implied do-loop.  Check that
+     here.  */
   c = gfc_peek_ascii_char ();
-  if (gfc_current_form == FORM_FREE && !gfc_is_whitespace (c))
+  if (gfc_current_form == FORM_FREE && !gfc_is_whitespace (c) && c != '(')
     return MATCH_NO;
 
   /* Before parsing the rest of a DATA statement, check F2008:c1206.  */
index 0e8e141..917a75f 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/91372
+       * gfortran.dg/pr91372.f90: New test.
+
 2019-08-05  Marek Polacek  <polacek@redhat.com>
 
        PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
diff --git a/gcc/testsuite/gfortran.dg/pr91372.f90 b/gcc/testsuite/gfortran.dg/pr91372.f90
new file mode 100644 (file)
index 0000000..b948314
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR fortran/91372   
+module module_sf_lake
+    implicit none 
+    integer, parameter ::      r8 = selected_real_kind(12) 
+    integer, private  :: i
+    real(r8) :: sand(2)                           ! percent sand
+    data(sand(i), i=1,2)/92.,80./
+end module module_sf_lake