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

            Bug ID: 58009
           Summary: Elements with same value in vector subscript in
                    variable definition context
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org

The following is illegal:

program main
  real, dimension(4) :: a,b
  read (*,*) a
  b([1,2,3,2]) = a
  print *,b
end

See F 2008, 6.5.3.3.2:

If a vector subscript has two or more elements with the same value, an array
section with that vector subscript
shall not appear in a variable definition context (16.6.7)

Reply via email to