This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/77632] New: Pointer initialisation does not quite work
- From: "arjen.markus895 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 18 Sep 2016 13:15:40 +0000
- Subject: [Bug fortran/77632] New: Pointer initialisation does not quite work
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77632
Bug ID: 77632
Summary: Pointer initialisation does not quite work
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: arjen.markus895 at gmail dot com
Target Milestone: ---
The Fortran 2008 standard allows pointer variables to be initialised as:
real, dimension(100), target :: array
real, dimension(:), pointer :: parray => array
While the syntax is accepted, the result is not as expected. The following
program demonstrates this:
! test_pointer_init.f90 --
! It seems pointer initialisation is not working correctly?
!
program test_pointer_init
implicit none
real, dimension(100), target :: array
real, dimension(:), pointer :: alternative => array
! This prints "F" whereas I expect "T"
write( *, '(a,l)' ) ' Associated: ', associated(alternative,array)
end program test_pointer_init