https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85150

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> I get the ICE with 4.8 up to trunk (8.0). Compiling the test with 4.3.6
> gives the error
> 
>    integer, pointer :: buf_ptr => buf(buf_i) ! invalid
>                                  1
> Error: Pointer initialization requires a NULL() at (1)

4.3.6 did not support pointer initialization to anything
other than a null-init as 4.3.6 did not support Fortran
2008.  With Fortran 2008, it is legal to do 

integer, target :: m
integer, pointer :: n => m

I haven't looked too closely at Nathan's code, but it
may be invalid as buf_i is not a constant expression.

That is,

module mod_test
   implicit none
   integer, target :: buf(2)
   integer :: buf_i = 1

The above is not a named constant,

   integer, pointer :: buf_ptr => buf(buf_i) ! invalid

so it may not be valid Fortran to reference it here in
a specification statement.

end module mod_test

Reply via email to