"A variable, common block, or procedure pointer declared in the scoping unit of
a main program, module, or submodule implicitly has the SAVE attribute, which
may be confirmed by explicit specification." (F2008, 5.3.16 SAVE attribute).

In terms of the code generated, this already happens: The variables end up in
static memory. In the most cases, it also makes no difference in diagnostics;
however, there is one case.

Currently, the following program fails with
Error: Object 'a' at (1) must have the SAVE attribute for default
initialization of a component

module m
  type t
    integer :: a = 5
  end type t
  type(t) :: a
end module m


-- 
           Summary: [F2008] Implicit SAVE in MODULEs
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          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=43185

Reply via email to