+2020-03-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/93792
+ * decl.c (variable_decl): If param and initializer check
+ for BOZ, if found, output an error, set m to MATCH_ERROR
+ and goto cleanup.
+
2020-03-02 Andrew Benson <abensonca@gmail.com>
PR fortran/93486
goto cleanup;
}
else if (param && initializer)
- param->value = gfc_copy_expr (initializer);
+ {
+ if (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
+2020-03-05 Mark Eggleston <mark.eggleston@codethink.com>
+
+ PR fortran/93792
+ * gfortran.dg/pr93792.f90: New test.
+
2020-03-05 Delia Burduv <delia.burduv@arm.com>
* gcc.target/arm/simd/bf16_ma_1.c: New test.
--- /dev/null
+! { dg-do compile }
+! Original test case by Gernhard Steinmetz.
+
+module m
+ type t(n)
+ integer, len :: n = z'1'
+ end type
+end
+program p
+ use m
+ type(t(:)), allocatable :: z
+end
+
+! { dg-error "Parameterized type 't' does not have a component" " " { target *-*-* } 5 }
+! { dg-error "BOZ literal constant at .1. cannot appear" " " { target *-*-* } 6 }
+! { dg-error "Cannot open module file" " " { target *-*-* } 10 }
+! { dg-excess-errors "compilation terminated" }