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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
This one took a bit to find where to check for a BOZ.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 705d2326a29..7add59f50bd 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1268,6 +1274,17 @@ resolve_structure_cons (gfc_expr *expr, int init)
       else
         resolve_fl_struct (expr->ts.u.derived);

+      /* Walk the constructor looking for an invalid BOZ.  */
+      cons = gfc_constructor_first (expr->value.constructor);
+      for (; cons; cons = gfc_constructor_next (cons))
+       if (cons->expr && cons->expr->ts.type == BT_BOZ)
+         {
+           gfc_error ("boz-literal-constant at %L cannot appear as an "
+                       "entity in a structure constructor",
+                       &cons->expr->where);
+           return false;
+         }
+
       /* If this is a Parameterized Derived Type template, find the
         instance corresponding to the PDT kind parameters.  */
       if (expr->ts.u.derived->attr.pdt_template)

Reply via email to