https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82511

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fritzoreese at gmail dot com,
                   |                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
This appears to fix the problem.  But, I'm not too familiar
with how the DEC structure/union/map/record stuff works.
May be Fritz can take a quick peek. 

Index: io.c
===================================================================
--- io.c        (revision 253587)
+++ io.c        (working copy)
@@ -3536,6 +3536,14 @@ match_io_element (io_kind k, gfc_code **cpp)
       m = gfc_match_variable (&expr, 0);
       if (m == MATCH_NO)
        gfc_error ("Expected variable in READ statement at %C");
+
+      if (m == MATCH_YES && expr->ts.type == BT_DERIVED && expr->ts.kind == 0
+         && expr->ts.u.derived->attr.flavor == FL_STRUCT)
+       {
+               gfc_error ("Structure %qs at %L cannot be used as a variable",
+                          expr->symtree->name, &expr->where);
+               return MATCH_ERROR;
+       }
     }
   else
     {

Reply via email to