This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42912] New: BLOCK: C1278 - wrongly accepts SAVE in pure procedure
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2010 11:20:29 -0000
- Subject: [Bug fortran/42912] New: BLOCK: C1278 - wrongly accepts SAVE in pure procedure
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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