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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-02-18
                 CC|                            |kargl at gcc dot gnu.org
   Target Milestone|---                         |10.0
     Ever confirmed|0                           |1
      Known to fail|                            |10.0

--- Comment #1 from kargl at gcc dot gnu.org ---
This patch is against svn r280157.  The patch fixes the ICE.
Someone will need to convert the example code into a test
for the testsuite.

It seems PDT are handled differently than other components in
a user-defined derived type.

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 280157)
+++ gcc/fortran/decl.c  (working copy)
@@ -2913,7 +2913,16 @@ variable_decl (int elem)
          goto cleanup;
        }
       else if (param && initializer)
-       param->value = gfc_copy_expr (initializer);
+       {
+         if (initializer && initializer->ts.type == BT_BOZ)
+           {
+             gfc_error ("BOZ literal constant at %L cannot appear as an "
+                        "initializer", &initializer->where);
+             m = MATCH_ERROR;
+             goto cleanup;
+           }
+         param->value = gfc_copy_expr (initializer);
+       }
     }

   /* Before adding a possible initilizer, do a simple check for compatibility

Reply via email to