This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42008] Wrongly rejected derived types with default initializers in PURE procedures
- 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: 23 Nov 2009 12:38:08 -0000
- Subject: [Bug fortran/42008] Wrongly rejected derived types with default initializers in PURE procedures
- References: <bug-42008-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2009-11-23 12:38 -------
Does your patch still reject
pure function test()
integer, pointer :: p => null() ! INVALID per C1272
integer :: test
test = p
end function test
That is currently rejected as "Error: Initialization of pointer at (1) is not
allowed in a PURE procedure".
NAG f95 rejects it with:
"ERROR: Local variable P of PURE procedure TEST has the SAVE attribute"
as "p" gets implicitly declared as SAVE. There might well be a check for it in
gfortran already, but seemingly no test case.
If there is no such test case, could you also add it?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42008