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

            Bug ID: 112764
           Summary: Associating entity does not have target attribute if
                    selector has pointer attribute in associate block
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mscfd at gmx dot net
  Target Milestone: ---

The selector has the pointer attribute but association is with an array
section. The associating entity should have the target attribute even in this
case, right? gfortran complains with "Pointer assignment target is neither
TARGET nor POINTER", ifort and ifx accept it. Looks like a bug in gfortran, or
has i1 indeed no target attribute?



program assoc_target

implicit none

integer, dimension(:,:), pointer :: x
integer, pointer :: j

allocate(x(1:100,1:2), source=0)
associate(i1 => x(:,1))
   j => i1(1)
   print *, j
end associate
deallocate(x)

end program assoc_target

Reply via email to