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

            Bug ID: 97491
           Summary: Wrong restriction for VALUE arguments of pure
                    procedures
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

$ cat pure.f90 
pure function foo(x) result (ret)
  integer :: ret
  integer, value :: x
  x = x / 2
  ret = x
end function foo
$ gfortran pure.f90 
pure.f90:4:2:

    4 |   x = x / 2
      |  1
Error: Variable 'x' cannot appear in a variable definition context (assignment)
at (1) in PURE procedure

Reply via email to