mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/81027 (Assumed-shape array reported as deferred.)
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-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. From-SVN: r267437
This commit is contained in:
parent
b3c64ed0b0
commit
03b2d3defa
|
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -2869,9 +2869,16 @@ gfc_check_init_expr (gfc_expr *e)
|
|||
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:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
Loading…
Reference in New Issue