C1278 A local variable of a pure subprogram, or of a BLOCK construct within a
pure subprogram, shall not have the SAVE attribute.

However, the following is accepted:

pure subroutine foo()
  block
    integer, save :: i
    integer :: j = 5
  end block
end subroutine foo


Expected:

    integer, save :: i
                 1
Error: SAVE attribute at (1) cannot be specified in a PURE procedure

    integer :: j = 5
                    1
Error: Initialization of variable at (1) is not allowed in a PURE procedure


-- 
           Summary: BLOCK: C1278 - wrongly accepts SAVE in pure procedure
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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

Reply via email to