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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-02-05
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
Patch is against svn r280157.

This fixes the problem.

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 280157)
+++ gcc/fortran/decl.c  (working copy)
@@ -716,6 +716,22 @@ gfc_match_data (void)
       new_data->next = gfc_current_ns->data;
       gfc_current_ns->data = new_data;

+      /* A BOZ literal constant cannot appear in a structure constructor.
+        Check for that here for a data statement value.  */
+      if (new_data->value->expr->ts.type == BT_DERIVED
+         && new_data->value->expr->value.constructor)
+       {
+         gfc_constructor *c;
+         c = gfc_constructor_first (new_data->value->expr->value.constructor);
+         for (; c; c = gfc_constructor_next (c))
+           if (c->expr->ts.type == BT_BOZ)
+             {
+               gfc_error ("BOZ literal constant at %L cannot appear in a "
+                          "structure constructor", &c->expr->where);
+               return MATCH_ERROR;
+             }
+       }
+
       if (gfc_match_eos () == MATCH_YES)
        break;

Reply via email to