+2018-12-27 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/81027
+ * expr.c (gfc_check_init_expr): Distinguish assumed-shape versus
+ deferred-shape dummy arguments in an error message.
+
2018-12-26 Harald Anlauf <anlauf@gmx.de>
PR fortran/85407
break;
case AS_DEFERRED:
- gfc_error ("Deferred array %qs at %L is not permitted "
- "in an initialization expression",
- e->symtree->n.sym->name, &e->where);
+ if (!e->symtree->n.sym->attr.allocatable
+ && !e->symtree->n.sym->attr.pointer
+ && e->symtree->n.sym->attr.dummy)
+ gfc_error ("Assumed-shape array %qs at %L is not permitted "
+ "in an initialization expression",
+ e->symtree->n.sym->name, &e->where);
+ else
+ gfc_error ("Deferred array %qs at %L is not permitted "
+ "in an initialization expression",
+ e->symtree->n.sym->name, &e->where);
break;
case AS_EXPLICIT:
+2018-12-27 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/81027
+ * gfortran.dg/pr81027.f90: New test.
+ * gfortran.dg/initialization_7.f90: Update error message.
+
2018-12-27 Steven G. Kargl <kargl@gcc.gnu.org>
* libgomp.fortran/aligned1.f03: Fix invalid code that now causes
subroutine probleme(p)
real(kind=8), dimension(:) :: p
- integer :: nx = size(p, 1) ! { dg-error "Deferred array" }
+ integer :: nx = size(p, 1) ! { dg-error "Assumed-shape array" }
integer :: nix
nix = nx
--- /dev/null
+program badarray
+ implicit none
+ integer:: j(3) = [1,2,3]
+ call doubling(j)
+contains
+ subroutine doubling( n)
+ integer,intent(in)::n(:)
+ integer::m = size(n) ! { dg-error "Assumed-shape array" }
+ print *, m ! { dg-error "has no IMPLICIT type" }
+ end subroutine doubling
+end program badarray