On Mon, Nov 03, 2025 at 03:56:47PM -0800, Jerry D wrote:
> On 11/3/25 12:47 PM, Tobias Burnus wrote:
> > Hi Jerry,
> > 
> > Jerry D wrote:
> > > Regression tested on x86_64.
> > >              * resolve.cc (check_default_none_expr): Do not allow an
> > >              iterator in a locality spec.
> > 
> > Shouldn't be there a testcase for this? I see one for the other issue,
> > namely ...
> > 
> > > Allow a named constant to be
> > >              used within the loop.
> > > 
> > >      gcc/testsuite/ChangeLog:
> > >              * gfortran.dg/pr122513.f90: New test.
> > 
> > has this testcase.
> > 
> > I think the one of https://gcc.gnu.org/bugzilla/show_bug.cgi?
> > id=122513#c7 with the message you show in comment 8 will work.
> > 
> > Thanks otherwise to you for packaging, to Steve for the patch, to
> > Alexander for the report and Harald for the patch review.
> > 
> > Tobias
> > 
> 
> The test case I provided fails to compile before the patch so I thought it
> was sufficient since the new logic avoids rejecting valid.
> 
> Regards,
> 

This might be my mistake.  I should have included a test
for the code (i.e., accepting the named constant) and 
a test of rejecting the do index in a locality spec.
I'm not at a system where I can test the code, but it
is something like


! { do-compile }
program test
   implicit none
   integer :: i
   do concurrent (i=1:2) default (none) local(i)   ! { dg-error XXXXX }
      block
        integer, dimension(2,3), parameter :: &
             ii = reshape((/ 1,2,3,4,5,6 /), (/2, 3/))
        print*,ii(i,:)
      end block
   end do
end program test


Note, there could be a testcase that already catches this
error.  I have looked, yet.


-- 
Steve

Reply via email to