Sorry, forgot to mention: regtested on i686-pc-linux-gnu Harald
On 11/19/16 15:42, Harald Anlauf wrote: > Hi Steve, all, > > On 11/19/16 02:18, Steve Kargl wrote: >> The error message is still not clear. 42 is a scalar integer. Why >> not use the language in the standard? >> >> C739 (R753) The index-name shall be a named scalar variable of type integer. > > I had adjusted the error message to the same appearing in resolve.c > in another place, but you are absolutely right. The attached patch > takes this into account. The testcase is derived from the PR. > >>> >>> Whoever wants to take this one. >>> >> >> Ever thought about getting a commit bit and getting more involved >> in gfortran development? I know 4 or 5 other gentlemen that would >> welcome you with open arms. >> > > Thanks. > > During the stabilization phase of gcc-6 I tried to understand more > of the internals of gfortran. However, most of the time I just got > lost. I therefore decided to tackle a few simple things. > > I don't have the resources to follow the development continuously, > especially when there are changes to ABI or module format. So it > makes more sense for me to wait till the dust settles. > > I'll try to find some time during the current stage 3 to check > whether there are regressions affecting my codes, but no promises. > > Harald > > > 2016-11-19 Harald Anlauf <anl...@gmx.de> > > PR fortran/69741 > * resolve.c (gfc_resolve_forall): Check for non-scalar index > variables. > > 2016-11-19 Harald Anlauf <anl...@gmx.de> > > PR fortran/69741 > * gfortran.dg/forall_18.f90: New testcase. > > Index: gfortran.dg/forall_18.f90 > =================================================================== > --- gfortran.dg/forall_18.f90 (revision 0) > +++ gfortran.dg/forall_18.f90 (revision 0) > @@ -0,0 +1,12 @@ > +! { dg-do compile } > +! PR 69741 - improve error message for non-scalar FORALL index variables > +! > +subroutine check > + integer :: ii(2), i, j > + real :: a(3,2) > + > + forall (ii(1)=1:3, ii(2)=1:2) ! { dg-error "scalar variable of type > integer" } > + a(ii(1),ii(2)) = ii(1) * ii(2) > + end forall > + > +end subroutine check > -- Harald Anlauf Dieburger Str. 17 60386 Frankfurt Tel.: (069) 4014 8318