------- Comment #11 from kargl at gcc dot gnu dot org  2010-05-31 21:54 -------
(In reply to comment #7)
> (In reply to comment #6)
> > because in the above 'i' and 'I' are in the same scoping unit.
> I couldn't find what mandates in the standard that i and I are in a different
> scoping unit/are different variables. Are they ?
> 
> > If you write 'i = 5; j = [(i,i=1,I)]' then the 'i' here is in
> > a different scoping unit.  I agree that the scalar-int-expr
> > '1' and 'I' need to be evaluated to establish the the loop
> > start and stop values.  The question again based on scoping
> > unit is whether 'I' is uninitialized.
> > 
> How could it be ?
> 

I don't understand what you are asking.

  integer j(5)
  I = 5
  j = (/ (i,i=1,I) /)  ! (i,i=m1,m2) for discussion below
  end 

'I' in line 2 is in the scope of the main program.
'i' in line 3 is in the scope of the implied-do-loop.
'I' in line 2 is not the same as 'i' in line 3.  The
only thing that 'i' in line 3 gets from 'I' in line 2
is its type and kind type parameter.  When 'i' in 
line 3 comes into scope, does 'I' in the m2 become
undefined?  I can't find anything in the standard
that states that it becomes undefined and I can't
find anywhere that states that it is still defined to
have a value of 5 in the evaluation of m2.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354

Reply via email to